You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both the CLASS and TYPE locatives seem to get the job done, so I might end up just picking one or another, by why isn't there a STRUCT locative? I did not use neither DEFCLASS nor DEFTYPE to define this TYPE, so neither one of CLASS or TYPE felt natural to use, when documenting my API.
If you were open to such an enhancement, and confirmed it wasn't too challening to implement, I might just give it a try.
The text was updated successfully, but these errors were encountered:
As you found, so far I made do with only the CLASS or TYPE locatives plus STRUCTURE-ACCESSOR for the slots. But I do agree that being a structure can be part of the contract (e.g. to allow DEFSTRUCT :INCLUDE).
If you want to take a stab at implementing it, the CONDITION locative should be a good starting point. And since structures are a general CL thing, the implementation belongs in mgl-pax/dref. The steps that I can see are basically:
dref/src/base/package.lisp
@TYPELIKE-LOCATIVES: add STRUCTURE
@DREF-SUBCLASSES: add STRUCTURE-DREF
dref/src/full/locatives.lisp
cargo-cult the CONDITION locative
dref/test/test-locate.lisp
add TEST-LOCATE/STRUCTURE
dref/test/test.lisp
TEST-DSPEC
TEST-DEFINITIONS
TEST-DOCSTRING
*SOURCE-LOCATION-TEST-CASES*
There may be portability issues, but I'm happy to iron those out if it works at least SBCL. Let me know how it goes.
Both the CLASS and TYPE locatives seem to get the job done, so I might end up just picking one or another, by why isn't there a STRUCT locative? I did not use neither DEFCLASS nor DEFTYPE to define this TYPE, so neither one of CLASS or TYPE felt natural to use, when documenting my API.
If you were open to such an enhancement, and confirmed it wasn't too challening to implement, I might just give it a try.
The text was updated successfully, but these errors were encountered: