News for hackers. Stuff that matters.
Re:Portacle – A Portable Common Lisp Development Environment by cronjobber on Wednesday January 04, 2017 @10:28AM (#13319012)
I'd count ubiquitous currying a design mistake in a dynamically typed language. All your "wrong number of arguments" errors get caught late.

(But the real problem with common lisp is that its version of (+ 2) is the ridiculously verbose (LAMBDA (x) (+ 2 x)) — far too many anonymous functions end up with more boilerplate than content. A decent reader macro might go a long way towards curing curry envy. If I remember correctly, it's [+ 2 _] in Paul Graham's Arc, not bad.)

Re:Portacle – A Portable Common Lisp Development Environment by lispm on Wednesday January 04, 2017 @10:43AM (#13319145)
Using reader macros for syntax is mostly a mistake - with exceptions. The Lisp tradition generally likes to use reader syntax on the level of s-expressions.

If verbose expressions are a problem, normal macros or functions would be sufficient.

    CL-USER 10 > (defmacro rlambda (fn &rest forms)
                  (let ((arg-sym (gensym "ARG-")))
                    `(lambda (,arg-sym)
                       (,fn ,@forms ,arg-sym))))
    RLAMBDA

    CL-USER 11 > (macroexpand-1 `(rlambda + 2))
    (LAMBDA (#:ARG-804) (+ 2 #:ARG-804))
    T
The 'real problem' is that many people have difficulties using and accepting a programmable programming language.
Re:Portacle – A Portable Common Lisp Development Environment by cronjobber on Wednesday January 04, 2017 @11:07AM (#13319374)
Your "solution" is still more boilerplate than content and befuddles people used to lisp by evaluating in the function namespace an argument in non-function position.

Common Lisp simply can't approach the succinctness and elegance of currying without adding some syntax.

Your resistance is puzzling, btw. You're not having difficulties using and accepting a programmable programming language, are you?

Re:Portacle – A Portable Common Lisp Development Environment by lispm on Wednesday January 04, 2017 @12:07PM (#13319976)
> used to lisp by evaluating in the function namespace an argument in non-function position.

True, macros can confuse people not used to the concept.

For example the DEFUN macro: (defun plus (a b) (+ a b))

'plus' is in the function namespace, even though it is in a non-function position.

Strange, isn't it?

> Common Lisp simply can't approach the succinctness and elegance of currying without adding some syntax.

That's true. But it doesn't even try, because the 'succinctness and elegance' of currying without adding some syntax is a non-goal for Common Lisp. Lisp has always preferred one expression for each function call and over the years it added complex argument lists (variable number of arguments, optional arguments, keyword arguments, ...).

Personally I don't miss things like 'automatic' currying, since they are making the code harder to read (-> currying is not explicitly visible in the source code) and debug.

Re:Portacle – A Portable Common Lisp Development Environment by davexunit on Wednesday January 04, 2017 @11:26AM (#13319568)
In Scheme there is the "cut" macro:

    (cut + 2 <>)
GNU Guile specifically has a curried definition syntax:

    (define ((foo x) y)
      (list x y))
https://www.gnu.org/software/guile/manual/html_node/Curried-...

Or you can bind "lambda" to another, shorter identifier.

But anyway, Lisp's goal isn't to be extremely terse, so it doesn't bother me.

Re:Portacle – A Portable Common Lisp Development Environment by bluefox on Wednesday January 04, 2017 @02:16PM (#13321174)
Lisp is not about microsyntax and code golf. If you worry about the number of characters and that is "the real problem" with Common Lisp, Perl or J may be a better choice for you.
Re:Portacle – A Portable Common Lisp Development Environment by mtraven on Wednesday January 04, 2017 @11:43AM (#13319743)
In Clojure it's #(+ 2 %), pretty compact if cryptic. Actually no reason you couldn't make a reader macro in CL to look similar.
Re:Portacle – A Portable Common Lisp Development Environment by jdminhbg on Wednesday January 04, 2017 @12:55PM (#13320437)
Slightly less cryptic would be (partial + 2).
Re:Portacle – A Portable Common Lisp Development Environment by topkekz on Thursday January 05, 2017 @09:10AM (#13327170)
Partial application and currying are two different things.
Re:Portacle – A Portable Common Lisp Development Environment by jdminhbg on Thursday January 05, 2017 @03:26PM (#13331033)
That's correct, I'm just responding to the specific case here.
Re:Portacle – A Portable Common Lisp Development Environment by PuercoPop on Wednesday January 04, 2017 @11:55AM (#13319846)