Re: unboxed structure fields (or class slots)

Martin Simmons <[email protected]>
Newsgroups gmane.lisp.lispworks.general
Message-ID <[email protected]>
Structure and CLOS instance slots are always boxed in LW.

The only general workaround to avoid boxing would be to have a vector of
length 1 with element type double-float to hold the value.

-- 
Martin Simmons
LispWorks Ltd
http://www.lispworks.com/



>>>>> On Wed, 7 Jan 2026 11:12:57 +0000, Tim Bradshaw (as tfb at tfeb dot org) said:
> 
> There are several easier ways than using the FLI, all of which come down to using a double-float array to hold the values.
> 
> The reason I'm asking is because I've been thinking about generalising my struct-of-arrays tool (whose purpose is to avoid this problem for implementations where it happens, amongst others).  I'm assuming LW can't do this.
> 
> --tim
> 
> 
> > On 6 Jan 2026, at 22:54, Alexey Veretennikov <[email protected]> wrote:
> > 
> > Hi,
> > 
> > I'm pretty sure you've tried it already but I would just define a fli C-struct, store a fli object allocated with fli:allocate-foreign-object for this struct as a class member and define a couple of accessor methods to access fields for the struct from your class, with the same naming conventions as the class accessors.
> > 
> > BR,
> > /Alexey
> > 
> > 
> > On Tuesday, January 6th, 2026 at 20:54, Tim Bradshaw (as tfb at tfeb dot org) <[email protected]> wrote:
> > 
> >> Are there any cases where LW can handle, for instance, unboxed doubles in structures (or CLOS instances).
> >> 
> >> I haven't been able to persuade it to.
> >> 
> >> --tim
> >> 
> >> _______________________________________________
> >> Lisp Hug - the mailing list for LispWorks users
> >> [email protected]
> >> http://www.lispworks.com/support/lisp-hug.html
> 
> 
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> [email protected]
> http://www.lispworks.com/support/lisp-hug.html
> 

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
[email protected]
http://www.lispworks.com/support/lisp-hug.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.