Arc Forumnew | comments | leaders | submitlogin
2 points by d0m 5177 days ago | link | parent

wops, the second example should evaluate to (t t nil nil nil)

I thought about making [] more powerful.. but I can't find a way to do it the "arc way".

What I am proposing is: instead of creating a special construct for currying, why not make a convention that all arc functions be currying?

so simply: (< 2) evaluate to [< 2 _] .. No special suggar, just by convention.

And for the cases where we want more powerful currying technics, we can still use the [] syntax.

I.e.: [> _ 2]



1 point by akkartik 5177 days ago | link

I'm sorry, I think I understand what you want, but the examples still aren't making sense:

You originally:

  (map (> 2) '(1 2 3 4 5)) -> (nil nil t t t)

  (map [> _ 2] '(1 2 3 4 5)) -> (nil nil t t t)
My response:

  (map (> 2) '(1 2 3 4 5)) -> (t t nil nil nil)

  (map [> _ 2] '(1 2 3 4 5)) -> (nil nil t t t)
Your response is this, am I right?

  (map (> 2) '(1 2 3 4 5)) -> (nil nil t t t)

  (map [> _ 2] '(1 2 3 4 5)) -> (t t nil nil nil)
But now both seem wrong. You used '<' sometimes; do you mean to use '<' everywhere?

Feel free to edit the original post to make the discussion clearer.

-----

1 point by d0m 5176 days ago | link

What I meant by "second example" was the "second map example". How can I edit the main post?

-----

1 point by akkartik 5176 days ago | link

Perhaps I see edit links longer because PG let me kill spam posts a while ago (they still time out eventually). Feel free to mail me the new version and I'll update the story (email in profile).

Update: Edit link is now gone.

-----