elkowar / eww

ElKowars wacky widgets
https://elkowar.github.io/eww
MIT License
9.16k stars 379 forks source link

[FEATURE] Allow more of simplexpr syntax in direct yuck #364

Open elkowar opened 2 years ago

elkowar commented 2 years ago

Description of the requested feature

Currently it's kind of confusing to have to put things like json access into {} when not in a string. It should be possible to just do

(foo :class some_var.something[2])

without the curlies, optimally.

Similarly, but larger scope, it would be nice to allow completely abandoning the simplexpr syntax by making math via (+ 1 some_var) possible and identical to {1 + some_var}

leg7 commented 1 year ago

Overall I think yuck would greatly benefit from being more "lispy". It's very strange to have lisp code interrupted by blocs of simplexpr and [].

Is there some reason to have these {}/[] things? Also was there a reason to make yuck instead of using an already existing lisp dialect?

PS: Sorry if this is not the appropriate place to ask.

xdevs23 commented 8 months ago

One place where this would be beneficial is:

:limit-width { {condition1 ? 10 : 20} + {condition2 ? 20 : 50} }

this results in:

error: Unexpected token `RCurl` encountered

In a more lisp way, it could be written as:

:limit-width {(+ (?: condition1 10 20) (?: condition2 20 50))}