Skip to content

Special syntax for symbolically-expanded fields? #40

@bryanedds

Description

@bryanedds

related discord convo with snipping -

dump — Today at 3:30 AM
i wonder if there's a way to make a visual distinction between expressions with symbolic expansions and expressions that are DU cases?
i guess syntax highlighting should do it if the editor has access to the schema

bryanedds — Today at 7:12 AM
ya, i'm not sure how to visually indicate the presence of symbolic expansion / compression on an s-expr without some sort of tool-tip type of thing.
there are a couple of caveats -

dump — Today at 7:13 AM
i guess a colon or something, but it's probably late to change the syntax now
and it doesn't quite fit the parsing or aesthetics of s-expressions

bryanedds — Today at 7:14 AM
first, there are only 3 out-of-box types that use symbolic expansion / compression: BasicParticle, MaterialProperties, and EffectDescriptor
so it's not terribly difficult for the user to memorize where these are
second, any other types that use them will be only be those specified by the user
Since I implemented a custom editor for MatProps yesterday, I could just remove the symb expn from that type as well
it might work tho

dump — Today at 7:21 AM
ah i see

bryanedds — Today at 7:21 AM
ya, they're also only used at the top level of those types
just to make them understandable

dump — Today at 7:22 AM
i guess it might also depend on whether you want to promote the use of the format outside of nu
i could definitely have made use of it at my previous job actually, since i did a lot of sensor logging

bryanedds — Today at 7:23 AM
this s-expression implementation is available from Prime, ya
so other people could use them

dump — Today at 7:24 AM
yeah

bryanedds — Today at 7:25 AM
i did write an article about it too - https://vsyncronicity.com/2020/03/01/s-expression-the-ultimate-format/

dump — Today at 7:25 AM
I was reading through your posts today actually haha
Specifically I was looking for that article

bryanedds — Today at 7:28 AM
It really would be nice to have a special syntax for sym expns tho, i agree
right now, the : character is reserved, so it's available to the parser.
and anything in the language needs to be homoiconic.
so what would the equality for x : y be?
right now, the equality for x.y is [Index x y]
so I guess it would be [Property x y]
altho maybe that's a little to specific a name...?
[Label x y] maybe?
ya, that sounds plausible

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions