Re: Program compression
- From: Richard Heathfield <rjh@xxxxxxxxxxxxxxx>
- Date: Sat, 26 Jul 2008 09:06:27 +0000
Robert Maas, http://tinyurl.com/uh3t said:
From: Jon Harrop <j...@xxxxxxxxxxxxxxxxx>Haskell, SML, OCaml, Mathematica, F# and Scala all allow realWhat does "solved much more concisely" mean??
problems to be solved much more concisely than with Lisp. Indeed, I
think it is difficult to imagine even a single example where Lisp
is competitively concise.
The solutions are shorter in modern FPLs.
OK, let's say you have a text string which contains the notation
for a nested list starting from the beginning of the string. How
many lines of code, in various modern FPLs, would it take to parse
that nested-list notation to produce an actual nested list
structure, and also report back in another value the position in
the string where the parse left off at the end of the nested-list
notation? In Common Lisp it's just one line of code:
(multiple-value-setq (ls ei) (read-from-string ts))
where ts has the given text string,
ls gets the resultant list structure,
and ei gets the resultant end index.
In any (even relatively sensible) language where it takes /more/ than one
line of code, it only takes more than one line the /first/ time - because
the programmer will wrap it into a function (or procedure, or subroutine,
or whatever) and, in future, call the function (or whatever). So this
conciseness argument is a mere canard, as all program tasks eventually
boil down to:
call existing_solution
which is a one-liner in pretty well any language.
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
.
- Follow-Ups:
- Re: Program compression
- From: Pascal J. Bourguignon
- Re: Program compression
- References:
- Re: Program compression
- From: Robert Maas, http://tinyurl.com/uh3t
- Re: Program compression
- From: Jon Harrop
- Re: Program compression
- From: Robert Maas, http://tinyurl.com/uh3t
- Re: Program compression
- Prev by Date: Re: Program compression
- Next by Date: Re: Program compression
- Previous by thread: Re: Program compression
- Next by thread: Re: Program compression
- Index(es):
Relevant Pages
|