News for hackers. Stuff that matters.
Re:The Lisp Curse (2011) by Jtsummers on Thursday February 25, 2016 @12:25PM (#11175981)
I do understand, but I'll also point out that that first expression will often (with longer variables or expressions in particular) be broken out like:

  (* (+ a b)
     (+ c d))
Which is readable, though not necessarily compact.

Also, * and + in the former, aren't strictly the same as in the latter. * and + take an arbitrary number of parameters in CL. From [0], `(* )` => `1`. I can't test, but I believe `(* 2)` => `2` (the spec doesn't describe the case of a single parameter, unless I'm missing it). `+` is the same, but `(+)` => `0` instead, it's identity value.

Order of operations is made more explicit, and, I've found, it's more useful to think of `+` and `*` as `sum` and `product` rather than `plus` and `times`.

[0] http://www.lispworks.com/documentation/HyperSpec/Body/f_st.h...

[1] http://www.lispworks.com/documentation/HyperSpec/Body/f_pl.h...

Re:The Lisp Curse (2011) by 21 on Thursday February 25, 2016 @12:54PM (#11176216)
Math does also have `sum` and `product` in the form of Sigma and Pi. Of course, not exactly the same thing (since they operate over a set, not discrete elements).

I would venture to say that the reason infix notation is naturally preferred is related to our psychology, the same way most human languages are SVO (Subject Verb Object) or SOV. VSO languages (Lisp like) are less prevalent.

In general my opinion is that when a majority vastly prefers one alternative, there is usually a strong reason for it (even if it may be irrational) and it's foolish to go against the grain.

Re:The Lisp Curse (2011) by stan_rogers on Thursday February 25, 2016 @02:19PM (#11176994)
I seem to recall that SOV (reverse Polish notation) is marginally more prevalent than SVO among the world's languages... though it is true that most creoles are SVO, which does at least seem to indicate that it's a default of sorts.
Re:The Lisp Curse (2011) by Jtsummers on Thursday February 25, 2016 @01:00PM (#11176253)
Infix is mostly used, in programming, within mathematical and logical expressions. But the majority of my code spends its time in some kind of chain of function calls, which has the verb first. Maybe if I did more with OO-languages I'd see it differently?
Re:The Lisp Curse (2011) by AnimalMuppet on Thursday February 25, 2016 @01:19PM (#11176435)
Interesting. OO syntax often is object.function(arguments), which is subject-verb-object order. I never thought of it that way before. You can throw some adverbs in among the arguments, too.
Re:The Lisp Curse (2011) by knughit on Thursday February 25, 2016 @09:49PM (#11179525)
That's correspondent with how Java and especially Obj-C and super especially AppleScript programmers try to write code that reads like COBOL, er, English.
Re:The Lisp Curse (2011) by knughit on Thursday February 25, 2016 @09:47PM (#11179521)
Lisp is VOO, not SVO.

Java is SVO.

C is VOO too.

Re:The Lisp Curse (2011) by rol on Thursday February 25, 2016 @05:23PM (#11178315)
If you have Quicklisp[1] installed you can install the "infix" package and get infix notation in Common Lisp[2]:

    $ sbcl
    This is SBCL 1.2.4.debian, an implementation of ANSI Common Lisp.
    More information about SBCL is available at <http://www.sbcl.org/>.
    
    > (ql:quickload 'infix)
    ; Loading package
    (INFIX)
    > #i(1 + 1)            ; addition
    
    2
    > #i(2^^128)           ; exponentiation
    
    340282366920938463463374607431768211456
    > (defun factorial (x)
         #i(if x == 0 then
              1
            else
              x * factorial(x-1)))       ; infix function call
    
    FACTORIAL
    > (factorial 5)
    
    120
    > #i(factorial(5) / factorial(6))
    
    1/6
    > '#i((a + b) * (c + d))      ; Put a ' before the #i() to see what code is generated
    
    (* (+ A B)
       (+ C D))
--

[1] - https://www.quicklisp.org/beta/ [2] - Don't know if there is a similar package for Scheme.

Re:The Lisp Curse (2011) by jrapdx3 on Thursday February 25, 2016 @11:21PM (#11179774)
> Don't know if there is a similar package for Scheme.

I have to agree with others in the thread that infix in Lisp/Scheme is not the convention, and IMO an awkward fit. Don't recall encountering infix in any published/shared code I've seen, it may exist, but to learn Scheme becoming comfortable with s-expr notation is definitely necessary.

However, there is SRFI 105[0] which describes "curly infix expressions". It's implemented in Guile 2.x, possibly available in a few others but evidently not had a lot of uptake among Schemes.

[0] http://srfi.schemers.org/srfi-105/srfi-105.html

Edit: added URL

Re:The Lisp Curse (2011) by adwf on Thursday February 25, 2016 @06:34PM (#11178736)
I wouldn't recommend using infix libraries if you really want to get into Common Lisp though. They're a bit of a crutch for people coming from other languages, but that's it.

Pretty much the whole language is based on Polish notation. The sooner you realise that + - * / are just function names like any other, the better you'll do.

For example:

  (+ 1 2 3)

  in plain symbols is just:

  (function parameter parameter parameter)
  
  But if I were to write my own addition function:

  (addition 1 2 3)

  it would also be:

  (function parameter parameter parameter)

  and so is:

  (http-request "http://www.google.com")

  (function parameter)
If you use infix notation, you're writing half your code in a competely different semantic to the other half. I can't imagine it helping people really get a proper grasp of how Common Lisp works.