Shirakumo / alloy

A new user interface protocol and toolkit implementation
https://shirakumo.github.io/alloy
zlib License
181 stars 12 forks source link

Examples on data classes. remap-data. Extending accessor-data. #36

Open bmiww opened 10 months ago

bmiww commented 10 months ago

Hey!

Dropping here some musings i've had while exploring the alloy data classes. Since the existing examples helped me get going - thought i'd write my own for the data classes while i was playing around with them. It's not a complete example on all the possible data classes - but it covers some of the points of interest i had. Namely - several of the data classes that inherit from object-data.

Which also got me going on playing around with the implementations of some of the data classes. The FEAT commits are as follows:

While writing the example - it irred me that whenever i would change the base object values directly - the observers of accessor-data or remap-data wouldn't fire - which ended up being my motivation for all this.

bmiww commented 10 months ago

Did some more playing around with the remap-data stuff - it's a bit uncomfortable to work with cross-package. Still interested if the direction was as intended. If not - i can still keep it around locally in my own project.

Shinmera commented 10 months ago

Heya, cool to see you're working with Alloy!

I'm far too tired to review this tonight but I'll take a proper look tomorrow. The only thing I saw on the quick is the enter+ thing which I'm not sure why it's needed when enter-all exists (or why it's a macro).

For some of these data things it's very well possible that I won't even remember how they were supposed to work or were half-abandoned prototypes.

bmiww commented 10 months ago

Yeah, no worries, the remap-data was broken as is - so no high stakes there.

I've still got some ideas that i might explore in the direction of data handling. For example the mapping argument in remap-data seems a bit clunky to use.

Also - after creating the pull request - i started playing around with remap-data in my project thing, And something still feels a bit iffy when closer to real classes.

Thanks for the enter-all mention. No point in enter+ being a macro, or existing at all. (relatively new to common-lisp - and been a while since i've used macros - so i'm macro power-hungry)

Shinmera commented 10 months ago

Sorry for the delay on the review. I forgot about it again and then had some personal issues that interfered.

Anyway, hope you've been having a good holiday season!

bmiww commented 10 months ago

As with any holiday - heavy ups and downs. Switched focuses during holiday, probably going to return to codey stuff come new year.

Have to figure out something for my fancy symbol mode for emacs. Looks like I'm producing off by one spacing on lines following ifs due to if being just one symbol "visually" on my side.