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
jbind is quite useful already, but it is somewhat hard-coded in functionality. Allowing arbitrary predicates is probably the biggest customization that can happen to it, so that one can do:
(njson:jbind #(1#'evenp3 (lambda (n) (= n 4)) five)
five)
And make sure that an array like #(1 8 3 4 X ...) passes the check and returns the provided X.
Problematic moment is: function and lambda forms conflict with optional value parsing due to being symbol conses.
So it's unclear what (function foo) means: a predicate reference or optional binding for function variable.
quoted symbols don't work for predicates either: they are symbol-lead conses too.
So it's either hard-coding the rules for function, lambda, quote etc. (which is really unreliable), or coming up with a new syntax. Risking too much bloat here...
The text was updated successfully, but these errors were encountered:
jbind
is quite useful already, but it is somewhat hard-coded in functionality. Allowing arbitrary predicates is probably the biggest customization that can happen to it, so that one can do:And make sure that an array like
#(1 8 3 4 X ...)
passes the check and returns the provided X.Problematic moment is:
function
andlambda
forms conflict with optional value parsing due to being symbol conses.(function foo)
means: a predicate reference or optional binding forfunction
variable.lambda
is easier to parse and harder to miss due to arglist presence, but JBIND/JMATCH: better optional value syntax (default values? nested destructuring?) #8 can change that too.quote
d symbols don't work for predicates either: they are symbol-lead conses too.So it's either hard-coding the rules for
function
,lambda
,quote
etc. (which is really unreliable), or coming up with a new syntax. Risking too much bloat here...The text was updated successfully, but these errors were encountered: