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
Immutable data types might be esp. of help for the html dialect for data binding in the spirit of React/Om where you can tell if something's changed very easily.
Not that SugarLisp isn't trying to be a clojure or an Elm etc. so I think it's good this would be optional.
But possibly there's a nice way to support them as a dialect? Something like (in SugarScript):
#use "html"
#use "immutable"
val boundval;
var input = <h2>${boundval}</h2>;
boundval = if? (new Date().getHours() > 11) "good afternoon" else "good morning";
Note the keyword "val" for an immutable value.
The goal here would be to generate the code needed for one of these immutable libraries for get/set expressions using a "val" variable, but letting the sugarlisp programmer use normal javascript-y syntax.
(I need to look closer at these libraries but James Long's post above hints that most immutable libraries have special requirements i.e. something like "immutable.set(x, 10)" not just "x = 10")
The text was updated successfully, but these errors were encountered:
Immutable data types might be esp. of help for the html dialect for data binding in the spirit of React/Om where you can tell if something's changed very easily.
see e.g. http://jlongster.com/Using-Immutable-Data-Structures-in-JavaScript
Not that SugarLisp isn't trying to be a clojure or an Elm etc. so I think it's good this would be optional.
But possibly there's a nice way to support them as a dialect? Something like (in SugarScript):
Note the keyword "val" for an immutable value.
The goal here would be to generate the code needed for one of these immutable libraries for get/set expressions using a "val" variable, but letting the sugarlisp programmer use normal javascript-y syntax.
(I need to look closer at these libraries but James Long's post above hints that most immutable libraries have special requirements i.e. something like "immutable.set(x, 10)" not just "x = 10")
The text was updated successfully, but these errors were encountered: