News for hackers. Stuff that matters.
Re:Practical Common Lisp (2005) by Koshkin on Saturday December 03, 2016 @01:59PM (#13096944)
> quirky inelegance

On the other hand, quoting Einstein's quote found in the famous book by Sussman and Wisdom who use Scheme to teach Classical Mechanics, "I adhered scrupulously to the precept of that brilliant theoretical physicist L. Boltzmann, according to whom matters of elegance ought be left to the tailor and to the cobbler.”

Re:Practical Common Lisp (2005) by dleslie on Saturday December 03, 2016 @02:19PM (#13097049)
Tailors and cobblers do practical tasks day in and day out; whereas physicists stretch their imagination to dream of the yet-known.

Somehow I think the analogy falls apart on close consideration. ;)

Re:Practical Common Lisp (2005) by taeric on Saturday December 03, 2016 @03:48PM (#13097427)
All analogies fall apart on close consideration.

In this case, though, I think it still works. It says nothing of the work they do, but more to the goal of their work. Tailors/coblers (fashion, in general) are tasked with making elegant attire. It is true that some are tasked with making practical attire.

Physicists, however, are never tasked with making elegant physics. It is rewarded. But it is not directly their task.

Re:Practical Common Lisp (2005) by jasonm23 on Saturday December 03, 2016 @07:58PM (#13098256)
I always enjoyed this take on analogies, and their consistent property of falling apart upon close consideration.

> An analogy is like a finger pointing at the moon, pay too much attention to the finger and you miss out on all the heavenly glory.

Re:Practical Common Lisp (2005) by qwertyuiop924 on Saturday December 03, 2016 @05:47PM (#13097871)
quirkyness isn't good in a PL: you want your language to act the way you'd expect, and have the arg orderings, function names, etc. That way, you don't get it wrong.
Re:Practical Common Lisp (2005) by brudgers on Saturday December 03, 2016 @09:05PM (#13098443)
[ANSI] Common Lisp may be unique among programming languages in that it is based on a standard and that standard was written to reflect how people were actually using Lisp after roughly thirty years of general use and about a decade of actual Common Lisp use.

The other thing about Lisps is that if a programmer doesn't like the order of arguments or the function names or even the parenthesis, the language lets them change whatever it is they don't like and the changed features still have first class status. That's also one of the criticisms of Lisps.

Re:Practical Common Lisp (2005) by qwertyuiop924 on Saturday December 03, 2016 @09:56PM (#13098581)
Yes, but the defaults matter.

And I do understand why CL is the way it is. That doesn't mean it's perfect (neither is Scheme: I just happen to prefer it).

Re:Practical Common Lisp (2005) by brudgers on Saturday December 03, 2016 @10:23PM (#13098636)
I think the specification committee for ANSI Common Lisp would have agreed that defaults matter. It's just that their criteria for defaults was "What professional programmers are doing right now".

Historically, Scheme somewhat dodged avoided issues like argument order by excluding functionality from the language spec. My experience is that once Scheme gets expanded out and becomes Racket, the many hands show up as inconsistencies among similar functions much like Common Lisp.

Clojure, to me, seems to have the right idea: procedures that abstract operations from data types...for example there is not one mapping procedure for lists and another mapping procedure for arrays. Racket seems to be headed in that direction.

Re:Practical Common Lisp (2005) by kbp on Saturday December 03, 2016 @10:31PM (#13098659)
> for example there is not one mapping procedure for lists and another mapping procedure for arrays.

In Common Lisp, MAP works just as well on either.

Re:Practical Common Lisp (2005) by brudgers on Sunday December 04, 2016 @12:41AM (#13098922)
In Clojure map also works on hashes and sets. In keeping with the previous discussion, there's also only one variety of map in Clojure. It's this orthogonality of operations and datatypes that I think is Clojure going in the right direction.

None of which is to say that Clojure isn't standing on the shoulders of giants.

Re:Practical Common Lisp (2005) by kbp on Sunday December 04, 2016 @01:24AM (#13099016)
You might be interested in the FSet library (among others): https://common-lisp.net/project/fset/Site/index.html
Re:Practical Common Lisp (2005) by thomasvarney723 on Sunday December 04, 2016 @03:54PM (#13101718)
Very well said. The advent of transducers in Clojure has made this 'orthogonality' especially true.
Re:Practical Common Lisp (2005) by qwertyuiop924 on Sunday December 04, 2016 @09:01AM (#13100000)
...And us schemers have the TinyCLOS derivatives, so our map could work on any DS: by default, however, it doesn't :-(.
Re:Practical Common Lisp (2005) by z0ltan on Sunday December 04, 2016 @07:28AM (#13099754)
I like the core Scheme language, but I never could get used to its macro syntax. I prefer Common Lisp macro syntax for that, and Clojure's macro system being very similar to that of Common Lisp is an added advantage!
Re:Practical Common Lisp (2005) by qwertyuiop924 on Sunday December 04, 2016 @06:53PM (#13102446)
Syntax-rules isn't great. But pretty much every scheme has recognized this, and added an imperative hygienic macro system (think Clojure's macro system, where you can't leak environment unless you want to, but better). There are three main choices at the moment: syntax-case, sc macros, and er/ir macros.

er (or explicit rename) macros are the simplest system: they're like CL macros, with a few minor differences. Also, because Scheme is a lisp-1 with a mutable global environment, you have to rename absolutely everything. Even lambda. Yes, really.

Because of this, CHICKEN (the only scheme that uses er macros) also has ir macros, which are like er macros, except that everything is implicitly renamed unless you say otherwise. However, expanding an ir macro is O(n) under the hood, which sucks. This is probably the worst part of CHICKEN, but it works well enough.

sc (syntactic closure) macros are similar to ir macros in nature, although the syntax and abstraction is different. It's a pretty nice system, currently used in Chibi and MIT scheme, and (while it's really too early to tell) seem to be the macro system most likely to make its way into R7RS-large.

Finally, there's syntax-case. It's used by racket (I think: racket's syntax-case has apparently been heavily extended) and guile, and is the R6RS macro system.

Personally, I don't like syntax-case. IMHO, it's overly complex, it throws away the standard macro abstraction for little benefit, and is generally a pain to use. But it's not objectively badly designed, and some people seem to like it (conveniently, this description, with some minimal modification, applies quite well to R6RS itself). You might be a person that likes it. I don't know. All I know is that I am not one of those people.