Remove failed syntax experiments #438

Closed
jckarter opened this Issue Oct 28, 2012 · 4 comments

Projects

None yet

2 participants

@jckarter
Owner

There are some bits of syntactic sugar that I think add complexity for little benefit, and occupy tokens that could be put to better use:

  • a: b as shorthand for ["a", b] isn't very generally useful and is potentially misleading.
  • The call-with-suffix syntax a(b): c -> { d; } is ungainly and also misleading.
  • The with form doesn't work very well for its intended purpose and is more confusing and verbose than writing monadic code using custom operators.

There are probably others. These should be removed or reconsidered.

@stepancheg
Collaborator

Oh, gods, you are rapidly changing features I like in Clay. I found a: b useful.

First, in recordWithProperties function, and utilities based on it. I even though that record statement should be transformed into record function.

Second, I used the shortcut in my JSON library:

var j = JsonObject([
    state: "ready",
    size: 26,
]);

Just sharing my impressions, not sure whether others need this feature or not.

(I agree with call-with-suffix, and I never used with statement).

@jckarter
Owner

Well, part of the reason I file issues is to get feedback first before changing things. a: b is very useful for record metaprogramming, but not so much elsewhere. I wonder if something better could supersede it, like a Python-style keyword feature.

@ghost
ghost commented Nov 17, 2012

I go with stepancheg because of too many braces in the code, as always ;)
Fine that you drop the weird with-syntax :)

@jckarter
Owner

@agemogolk did #2 and #3 in #441. The keyword syntax can stay since people like it. If native keyword arguments get implemented then those could supplant the syntactic sugar.

@jckarter jckarter closed this Nov 23, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment