Home > Archive > Functional > May 2007 > How Lisp's Nested Notation Limits The Language's Utility
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
How Lisp's Nested Notation Limits The Language's Utility
|
|
| Xah Lee 2007-05-04, 10:04 pm |
| How Lisp's Nested Notation Limits The Language's Utility
Xah Lee, 2007-05-03
There is a common complain by programers about lisp's notation, of
nested parenthesis, being unnatural or difficult to read. Long time
lisp programers, often counter, that it is a matter of conditioning,
and or blaming the use of =E2=80=9Cinferior=E2=80=9D text editors that are =
not
designed to display nested notations. In the following, i describe how
lisp notation is actually a problem, in several levels.
(1) Some 99% of programers are not used to the nested parenthesis
syntax. This is a practical problem. On this aspect along, lisp's
syntax can be considered a problem.
(2) Arguably, the pure nested syntax is not natural for human to read.
Long time lispers may disagree on this point.
(3) Most importantly, a pure nested syntax discourages frequent or
advanced use of function sequencing or compositions. This aspect is
the most devastating.
The first issue, that most programers are not comfortable with nested
notation, is well known. It is not a technical issue. Whether it is
considered a problem of the lisp language is a matter of philosophical
disposition.
The second issue, about nested parenthesis not being natural for human
to read, may be debatable. I do think, that deep nesting is a problem
to the programer. Here's a example of 2 blocks of code that are
syntactically equivalent in the Mathematica language:
vectorAngle[{a1_, a2_}] :=3D Module[{x, y},
{x, y} =3D {a1, a2}/Sqrt[a1^2 + a2^2] // N;
If[x =3D=3D 0, If[Sign@y =3D=3D=3D 1, =CF=80/2, -=CF=80/2],
If[y =3D=3D 0, If[Sign@x =3D=3D=3D 1, 0, =CF=80],
If[Sign@y =3D=3D=3D 1, ArcCos@x, 2 =CF=80 - ArcCos@x]
]
]
]
SetDelayed[vectorAngle[List[Pattern[a1,B
lank[]],Pattern[a2,Blank[]]]],
Module[List[x,y],
CompoundExpression[
Set[List[x,y],
N[Times[List[a1,a2],
Power[Sqrt[Plus[Power[a1,2],Power[a2,2]]
],-1]]]],
If[Equal[x,0],
If[SameQ[Sign[y],1],Times[=CF=80,Power[2
,-1]],
Times[Times[-1,=CF=80],Power[2,-1]]],
If[Equal[y,0],If[SameQ[Sign[x],1],0,=CF=
80],
If[SameQ[Sign[y],1],ArcCos[x],
Plus[Times[2,=CF=80],Times[-1,ArcCos[x]]]]]]]]]
In the latter, it uses a full nested form (called FullForm in
Mathematica). This form is isomorphic to lisp's nested parenthesis
syntax, token for token (i.e. lisp's =E2=80=9C(f a b)=E2=80=9D is Mathemati=
ca's
=E2=80=9Cf[a,b]=E2=80=9D). As you can see, this form, by the sheer number o=
f nested
brackets, is in practice problematic to read and type. In Mathematica,
nobody really program using this syntax. (The FullForm syntax is
there, for the same reason of language design principle shared with
lisp of =E2=80=9Cconsistency and simplicity=E2=80=9D, or the commonly toute=
d lisp
advantage of =E2=80=9Cdata is program; program is data=E2=80=9D.)
The third issue, about how nested syntax seriously discourages
frequent or advanced use of inline function sequencing on the fly, is
the most important and I'll give further explanation below.
One practical way to see how this is so, is by considering unix's
shell syntax. You all know, how convenient and powerful is the unix's
pipes. Here are some practical example: =E2=80=9Cls -al | grep xyz=E2=80=9D=
, or =E2=80=9Ccat a
b c | grep xyz | sort | uniq=E2=80=9D.
Now suppose, we get rid of the unix's pipe notation, instead, replace
it with a pure functional notation: e.g. (uniq (sort (grep xyz (cat a
b c)))), or enrich it with a composition function and a pure function
construct (=CE=BB), so this example can be written as: ((compose (lambda
(x) (grep xyz x)) sort uniq) (cat a b c)).
You see, how this change, although syntactically equivalent to the
pipe =E2=80=9C|=E2=80=9D (or semantically equivalent in the example using f=
unction
compositions), but due to the cumbersome nested syntax, will force a
change in the nature of the language by the code programer produces.
Namely, the frequency of inline sequencing of functions on the fly
will probably be reduced, instead, there will be more code that define
functions with temp variables and apply it just once as with
traditonal languages.
A language's syntax or notation system, has major impact on what kind
of code or style or thinking pattern on the language's users. This is
a well-known fact for those acquainted with the history of math
notations.
The sequential notation =E2=80=9Cf@g@h@x=E2=80=9D, or =E2=80=9Cx//h//g//f=
=E2=80=9D, or unixy =E2=80=9Cx|h|g|
f=E2=80=9D, are far more convenient and easier to decipher, than =E2=80=9C(=
f (g (h
x)))=E2=80=9D or =E2=80=9C((compose h g f) x)=E2=80=9D. In actual code, any=
of the f, g, h
might be a complex pure function (aka lambda construct, full of
parenthesis themselves).
Lisp, by sticking with almost uniform nested parenthesis notation, it
immediately reduces the pattern of sequencing functions, simply
because the syntax does not readily lend the programer to it as in the
unix's =E2=80=9Cx|h|g|f=E2=80=9D. For programers who are aware of the codin=
g pattern
of sequencing functions, now either need to think in terms of a
separate =E2=80=9Ccomposition=E2=80=9D construct, and or subject to the much
problematic typing and deciphering of nested parenthesis.
(Note: Lisp's sexp is actually not that pure. It has ad hoc syntax
equivalents such as the =E2=80=9Cquote=E2=80=9D construct =E2=80=9C '(a b c=
) =E2=80=9D, and also =E2=80=9C`=E2=80=9D,
=E2=80=9C#=E2=80=9D, =E2=80=9C,@=E2=80=9D constructs, precisely for the pur=
pose of reducing
parenthesis and increasing readability. Scheme's coming standard the
R6RS =E2=86=97, even proposes the introduction of [] and {} and few other
syntax sugars to break the uniformity of nested parenthesis for
legibility. Mathematica's FullForm, is actually a pure nested notation
as can be.)
-------
The above, is part of a 3-part exposition:
=E2=80=9CThe Concepts and Confusions of Prefix, Infix, postfix and Fully
Functional Notations=E2=80=9D,
=E2=80=9CPrefix, Infix, postfix notations in Mathematica=E2=80=9D,
=E2=80=9CHow Lisp's Nested Notation Limits The Language's Utility=E2=80=9D,
archived at:
http://xahlee.org/UnixResource_dir/writ/notations.html
Xah
xah@xahlee.org
=E2=88=91 http://xahlee.org/
| |
| Kaz Kylheku 2007-05-04, 10:04 pm |
| On May 4, 5:11=C2=A0pm, Xah Lee <x...@xahlee.org> wrote:
> How Lisp's Nested Notation Limits The Language's Utility
>
> Xah Lee, 2007-05-03
>
> There is a common complain by programers about lisp's notation, of
> nested parenthesis, being unnatural or difficult to read.
That is false. The complaint does not frequently occur among all of
the complaints occured by the entire population of complaintive
programmers.
> (1) Some 99% of programers are not used to the nested parenthesis
> syntax. This is a practical problem.
Since 99% of programmers don't use Lisp, it's not a practical problem.
> (2) Arguably, the pure nested syntax is not natural for human to read.
> Long time lispers may disagree on this point.
Programming language syntax shouldn't be natural for humans to read.
Or, rather, this shouldn't be a requirement which creates technical
compromises.
> (3) Most importantly, a pure nested syntax discourages frequent or
> advanced use of function sequencing or compositions.
That is an artifact of the way in which function composition is
rendered in nested syntax, and not an artifact of that syntax itself.
There exist macros that provide alternate syntax for function
composition, such as a left-to-right pipeline.
> This aspect is the most devastating.
Compared to issues like global warming and problems in the Middle
East, hardly.
> The first issue, that most programers are not comfortable with nested
> notation, is well known.
Many programmers are also not comfortable in social situations. So
what?
> shell syntax. You all know, how convenient and powerful is the unix's
> pipes. Here are some practical example: =E2=80=9Cls -al | grep xyz=E2=80=
=9D, or =E2=80=9Ccat a
> b c | grep xyz | sort | uniq=E2=80=9D.
>
> Now suppose, we get rid of the unix's pipe notation, instead, replace
> it with a pure functional notation: e.g. (uniq (sort (grep xyz (cat a
> b c)))),
When you think about this more deeply (i.e. at all) you run into nasty
details. These programs pass their output to each other, but they also
have a return value (termination status) which isn't passed through
the pipeline. And they take arguments, but the arguments of a pipeline
element are not derived from the previous pipeline element.
Your call (grep xyz (cat ...)) means to pass the output of cat as the
third argument of grep.
In the POSIX shell, this would be coded using guess what, Lisp-like
syntax:
grep xyz $(cat ...)
Taking it further:
uniq $(sort $(grep xyz $(cat a b c)))
or enrich it with a composition function and a pure function
> construct (=CE=BB), so this example can be written as: ((compose (lambda
> (x) (grep xyz x)) sort uniq) (cat a b c)).
I posted a filter macro in comp.lang.lisp which expresses function
chaining into a left-to-right notation. Look for it.
In this notation, you might write:
(filter 3 (expt _ 2) (* 4))
which means, start with 3, raise it to the power of 2 to obtain 9, and
then multiply by 4 to get 36.
The underscore indicates the argument position where the output of the
previous pipeline element is to be inserted when calling the next
pipeline element. The default is to add it as a rightmost argument.
The macro has features for dealing with splitting and recombining
lists, and handling multiple values.
This is still the same ``pure nested'' syntax; it merely expresses
function chaining differently.
What was that about notation limiting language utility?
| |
| Jon Harrop 2007-05-04, 10:04 pm |
| Kaz Kylheku wrote:
> On May 4, 5:11_pm, Xah Lee <x...@xahlee.org> wrote:
>
> Since 99% of programmers don't use Lisp, it's not a practical problem.
If you're being pedantic, you may mean "it is an uncommon practical
problem". However, the problem extends beyond Lisp.
Recent discussions have covered the use of pattern matching. In SML, OCaml,
Haskell (I believe) and F# you must write pattern matches over the expr
type in prefix notation. To borrow from Alan's example, the Lisp code:
(destructuring-bind (op1 (op2 n x) y) form
`(* ,n (* ,(simplify x) ,(simplify y)))))
((cons (eql *) *)
(destructuring-bind (op left right) form
(list op
(simplify left)
(simplify right))))
((cons (eql +)
(cons (eql 0)
(cons * null)))
could be written:
| n*x*y -> n*(x*y)
but in ML this must be written as a pattern match over a sum type where the
type constructors must use prefix notation:
| Mul(Mul(n, x), y) -> Mul(n, Mul(x, y))
While this is clearly much better than the Lisp, it would be preferable to
use the mathematical syntax in this case. You can address this in OCaml
using macros and there is a chance that F# will support overloaded
operators in patterns in the future.
Mathematica lets you do:
n x y -> n (x y)
but I don't know of any other languages that do, without forcing you to
reinvent the wheel via macros.
--
Dr Jon D Harrop, Flying Frog Consultancy
The F#.NET Journal
http://www.ffconsultancy.com/produc...journal/?usenet
| |
| Robert D. Crawford 2007-05-04, 10:04 pm |
| Xah Lee <xah@xahlee.org> writes:
> How Lisp's Nested Notation Limits The Language's Utility
You know, I am all about keeping one's eyes open so as to see the
limitations of the tools one chooses or is forced to use. If more
people were open to the flaws in their OS, religion, editor, and a
myriad of other things the world would surely be a better and more
peaceful place. However, I have to say that all I ever see from you,
Mr. Lee, is complaints and how you want emacs and lisp to change. For
the love of whatever god you choose to pray to, find a frigging tool
that makes you happy. If it is emacs that makes you happy, then change
the things you don't like and be happy but I fail to see how your
whining diatribes serve any useful purpose. If you don't like lisp then
by all means use something else.
No offense but it does get old after a while.
--
Robert D. Crawford rdc1x@comcast.net
Marriage is learning about women the hard way.
| |
| Miles Bader 2007-05-04, 10:04 pm |
| "Robert D. Crawford" <rdc1x@comcast.net> writes:
> If it is emacs that makes you happy, then change the things you don't
> like and be happy but I fail to see how your whining diatribes serve
> any useful purpose. If you don't like lisp then by all means use
> something else.
Xahlee likes to complain. That's the main factor here.
-Miles
--
Run away! Run away!
| |
| Rayiner Hashem 2007-05-05, 8:02 am |
| > (1) Some 99% of programers are not used to the nested parenthesis
> syntax. This is a practical problem. On this aspect along, lisp's
> syntax can be considered a problem.
The first time I saw graph-theory notation, I thought it was
gibberish. I still think most mathematical notation is gibberish, but
I deal with it --- I don't turn in proofs written in prose.
> (2) Arguably, the pure nested syntax is not natural for human to read.
> Long time lispers may disagree on this point.
And mathematical notation is not natural for people to read, at least
not anybody who grew up learning a natural language. But people deal
with it. They're remarkably adaptable this way.
> vectorAngle[{a1_, a2_}] :=3D Module[{x, y},
> =C2=A0 =C2=A0 {x, y} =3D {a1, a2}/Sqrt[a1^2 + a2^2] // N;
> =C2=A0 =C2=A0 If[x =3D=3D 0, If[Sign@y =3D=3D=3D 1, =CF=80/2, -=CF=80/2],
> =C2=A0 =C2=A0 =C2=A0 If[y =3D=3D 0, If[Sign@x =3D=3D=3D 1, 0, =CF=80],
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 If[Sign@y =3D=3D=3D 1, ArcCos@x, 2 =CF=80 - A=
rcCos@x]
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 ]
> =C2=A0 =C2=A0 =C2=A0 ]
> =C2=A0 =C2=A0 ]
Speaking of gibberish. I can't believe anybody would hold up
Mathematica as an example of good programming. Next you'll be telling
me that 99% of Matlab code isn't really crap!
> The third issue, about how nested syntax seriously discourages
> frequent or advanced use of inline function sequencing on the fly, is
> the most important and I'll give further explanation below.
I consider this to be a Good Thing (TM). Unix shell commands read like
line noise.
| |
| Edward 2007-05-05, 8:02 am |
| Xah Lee <xah@xahlee.org> writes:
> How Lisp's Nested Notation Limits The Language's Utility
>
> Xah Lee, 2007-05-03
>
> There is a common complain by programers about lisp's notation, of
> nested parenthesis, being unnatural or difficult to read. Long time
> lisp programers, often counter, that it is a matter of conditioning,
> and or blaming the use of “inferior” text editors that are not
> designed to display nested notations. In the following, i describe how
> lisp notation is actually a problem, in several levels.
As a practical matter, most LISPers don't even see the parens, but
rather interpret the code according to the indentation.
> (1) Some 99% of programers are not used to the nested parenthesis
> syntax. This is a practical problem. On this aspect along, lisp's
> syntax can be considered a problem.
It's certainly different. Whether it is a problem or not depends on
personal or subjective criteria.
> (2) Arguably, the pure nested syntax is not natural for human to read.
> Long time lispers may disagree on this point.
Harder to read for some things, easier to read for others.
E.G.
1 + 2 + 3 + 4 + 6 - 3 + 32
or
(- (+ 1 2 3 4 6 32) 3)
> (3) Most importantly, a pure nested syntax discourages frequent or
> advanced use of function sequencing or compositions. This aspect is
> the most devastating.
This is one reason LISP has macros. Don't like the syntax? Make your
own. How many languages make this as easy as LISP does?
> The third issue, about how nested syntax seriously discourages
> frequent or advanced use of inline function sequencing on the fly,
> is the most important and I'll give further explanation below.
>
> One practical way to see how this is so, is by considering unix's
> shell syntax. You all know, how convenient and powerful is the
> unix's pipes. Here are some practical example: “ls -al | grep xyz”,
> or “cat a b c | grep xyz | sort | uniq”.
>
> Now suppose, we get rid of the unix's pipe notation, instead,
> replace it with a pure functional notation: e.g. (uniq (sort (grep
> xyz (cat a b c)))), or enrich it with a composition function and a
> pure function construct (λ), so this example can be written as:
> ((compose (lambda (x) (grep xyz x)) sort uniq) (cat a b c)).
(pipe (cat a b c) (grep xyz) (sort) (uniq))
'Nuff said.
UNIX pipe `|' is not just a throw-away syntactic separator, anyone
with LISP experience would see it for what it is: a function that
operates on functions.
> Lisp, by sticking with almost uniform nested parenthesis notation,
> it immediately reduces the pattern of sequencing functions, simply
> because the syntax does not readily...<snip>
I would contend that LISP did not do this. You did.
<snip>
> (Note: Lisp's sexp is actually not that pure. It has ad hoc syntax
> equivalents such as the “quote” construct “ '(a b c) ”, and also
> “`”, “#”, “,@” constructs, precisely for the purpose of reducing
> parenthesis and increasing readability. Scheme's coming standard the
> R6RS ↗, even proposes the introduction of [] and {} and few other
> syntax sugars to break the uniformity of nested parenthesis for
> legibility. Mathematica's FullForm, is actually a pure nested
> notation as can be.)
Some functions are used so often, they have shorthand equivalents.
This is a feature in many languages. But if for some reason one
wanted the sexp to be "pure," nothing's stopping him from using the
fully-parenthesized versions.
> -------
> The above, is part of a 3-part exposition:
> “The Concepts and Confusions of Prefix, Infix, postfix and Fully
> Functional Notations”,
> “Prefix, Infix, postfix notations in Mathematica”,
> “How Lisp's Nested Notation Limits The Language's Utility”,
> archived at:
> http://xahlee.org/UnixResource_dir/writ/notations.html
>
> Xah
> xah@xahlee.org
> ∑ http://xahlee.org/
>
I suggest you start to acquaint yourself with LISP before getting too
far into the exposition:
http://gigamonkeys.com/book/
--
Edward
| |
| fireblade 2007-05-05, 8:02 am |
| > \|||/
> (o o)
> |~~~~ooO~~(_)~~~~~~~|
> | Please |
> | don't feed the |
> | TROLL! |
> '~~~~~~~~~~~~~~Ooo~~'
> |__|__|
> || ||
> ooO Ooo
>
| |
| Xah Lee 2007-05-05, 8:02 am |
| Xah Lee wrote:
=C2=AB(1) Some 99% of programers are not used to the nested parenthesis
syntax. This is a practical problem. On this aspect along, lisp's
syntax can be considered a problem.=C2=BB
Ken Tilton wrote:
=C2=ABSimply wrong. What would be a problem would be if they tried it and
could not quickly get used to it.=C2=BB
I think what you said is part of what i said. But let me elaborate.
Lisp's nested parenthesis certainly is a problem, if you want to
attract programers to lisp and programers are not attracted by sexp in
the first place.
What you expressed, is to consider the question of whether people can
get used to sexp. If programers cannot adapt sexp and find it
comfortable as a syntax of a programing language, then, you consider
THAT, to be a problem of the lisp syntax. Otherwise no problemo.
I think you vantage point is not so goody. But if we consider the
question itself, i think yes, people can adapt and use sexp reasonable
well for programing. Actually, this has been already done i guess by
lispers for 40+ years right? But if we really focus on this point of
view, namely: whether sexp can be suitable as a syntax for computing
language. Then, that is rather not a interesting question i thinky.
Because, in general, people can adapt to all kind of wierd shits,
really depending how pressing the matter is. If it is life
threatening, or they have no other choice, human animals can adapt.
Imagine, compare, the technology today are far advanced than 40 years
ago. Computers are what? a thousand, ten thousand times faster? And
there's no Perl, Python, Java, Internet 40 years ago. But People went
to the Moon! Imagine, what kind of torturous pain these people have
to go thru in software and hardware or the computation of mathematics
to do this. BASIC with GOTO and FORTRAN? What? no structured
constructs? No code blocks? No libraries? No symbols? No macros? Not
even Eval()? No USB and DVDs but punchcards?
You know about Chinese characters right? To a European, Chinese
characters looks torturous. But in fact it is. Just consider the
number of strokes. But i think Chinese people of 13 billion are
surviving.
Sure. I certainly agree human animals can get used to sexp. Under
some conditions, human animals can get used to a lot of things, and
loving it too.
See:
=E2=80=A2 =E2=80=9CBody and Mind Modification=E2=80=9D
http://xahlee.org/Periodic_dosage_d...9_body_mod.html
=E2=80=A2 =E2=80=9CDifficulty Perceptions in Human Feats=E2=80=9D
http://xahlee.org/vofli_bolci/juggling.html
The interesting question would be, to what degree of botchedness of
computer language syntax can be, until programers will not be able to
adapt it and code it fruitfully? Suppose, for each paren in lisp, we
double it. So, =E2=80=9C(+ 3 4)=E2=80=9D will be written as =E2=80=9C((+ 3 =
4))=E2=80=9D. And suppose
we force this to be the new syntax for lisp. I will bet you one
hundred bucks, that all lispers will find in exactly as easy to read
as before.
How many level of parens do you think we can add till all lispers
abandon ship?
How many?
----------------------------
Xah Lee wrote:
=C2=AB(2) Arguably, the pure nested syntax is not natural for human to
read. Long time lispers may disagree on this point.=C2=BB
Kenny wrote:
=C2=ABNo code is natural to read, and yes, I have written a ton of COBOL.
Neither are legal or scholarly natural language texts natural to
read.=C2=BB
Huh? surely you agree that there is at least some qualification as to
some written language being more natural or easier to read?
For example, compare language A and B, where A is just lisp's sexp,
and B is sexp with every paren replaced by double parens. Now, which
is more =E2=80=9Cnatural=E2=80=9D or easy to read?
So, likewise, compare Perl and Python. Which is easier to read in
general? You can't wax philosophy on this can you?
Imagine a philosophical scenario, where a devil killed off all
pythoners on earth. Therefore perl code is easier to read, because
nobody would understand a XXXX when shown a python code. So, the
question of whether Perl or Python code is easier to read, depends.
Also, i mean, it depends on the programer!! Because, if i write Perl
code versus a moron writing in Python, then my Perl code will sure be
easier to read. So, it also depends on me.
What a great tough undecidability!
----------------------------
Xah Wrote:
=C2=AB(3) Most importantly, a pure nested syntax discourages frequent or
advanced use of function sequencing or compositions. This aspect is
the most devastating.=C2=BB
Kenny wrote:
=C2=ABThe example you chose was a command line, where conciseness rules and
where one is not likely to encounter refactoring or macros. ie, the
syntax for a command-line has nothing to do with the syntax for
serious programming.=C2=BB
Yes the example i gave was unix's shell. It is chosen because it is
simple to illustrate and widely known.
I could give Mathematica examples with explanations... but its not
suitable as the simple unix pipe example because then i'll have to
spend great space explaining Mathematica.
(if anyone is interested in Mathematica syntax, i explained some here
http://xahlee.org/UnixResource_dir/writ/notations.html
)
But anyway, here's a few mathematica example from my Plane Tiling
package.
Here's one line that's the most simple to understand:
Reflect2DGraphics[{a1_, a2_}, {n1_, n2_}][gra_] :=3D
(Translate2DGraphics[{n1, n2}])@
(Reflect2DGraphics[{a1,a2}])@
(Translate2DGraphics[-{n1, n2}][gra]);
Basically, you'll see on the right side are 3 sequence of functions.
The left side is a function applied to a function. i.e.
Reflect2DGraphics takes 2 vectors and =E2=80=9Creturns=E2=80=9D a function =
that takes
one graphics argument. (it doesn't actually return a function since
it's written as pattern matching... but you can think of it as a
function generator)
Here's the lispy form some lisper believe is easier to read:
CompoundExpression[
SetDelayed[
Reflect2DGraphics[List[Pattern[a1, Blank[]], Pattern[a2,
Blank[]]],
List[Pattern[n1, Blank[]], Pattern[n2, Blank[]]]][
Pattern[gra, Blank[]]],
Translate2DGraphics[List[n1, n2]][
Reflect2DGraphics[List[a1, a2]][
Translate2DGraphics[Times[-1, List[n1, n2]]][gra]]]], Null]
The following are more code. They involve pure functions, function
application, function mapping, function generator applied to
functions... and basically all done with flat sequencing of functions
when possible. (aka function chaining sans nesting). Whenever you see
the ampersand sign &, its a pure function (aka lambda). Some pure
function has pure function as its innards.
These are written in 1997, by yours truely. I would say, if you have
not been coding lisp or Mathematica for, say, 40 hours a w for 4
years, you wouldn't understand these code when explained. (not
considering the math it is doing)
Okie, here's a good one. Lots of sequencing of pure functions on the
fly:
cycledMatrix[{m_Integer, n_Integer}, cycleLists : {_List ..}] :=3D
Module[{}, (Flatten[({Table[#1, {Quotient[#2, #3]}],
Take[#1, Mod[#2, #3]]} &) @@ ({#, m,
Length@#} &)@#] &) /@
Flatten[(({(Flatten[#, 1] &)@Table[#1, {Quotient[#2, #3]}],
Take[#1, Mod[#2, #3]]} &) @@ ({#, n, Length@#} &)@
cycleLists), 1]];
Btw, the =E2=80=9Cf@@g=E2=80=9D you see is shortcut syntax for =E2=80=9CAp=
ply[f,g]=E2=80=9D.
Here's the equivalent lispy form, lispers think its easier to read:
CompoundExpression[
SetDelayed[
cycledMatrix[
List[Pattern[m, Blank[Integer]], Pattern[n, Blank[Integer]]],
Pattern[cycleLists, List[Repeated[Blank[List]]]]],
Module[List[],
Map[Function[
Flatten[Apply[
Function[
List[Table[Slot[1], List[Quotient[Slot[2],
Slot[3]]]],
Take[Slot[1], Mod[Slot[2], Slot[3]]]]],
Function[List[Slot[1], m, Length[Slot[1]]]]
[Slot[1]]]]],
Flatten[Apply[
Function[
List[Function[Flatten[Slot[1], 1]][
Table[Slot[1], List[Quotient[Slot[2],
Slot[3]]]]],
Take[Slot[1], Mod[Slot[2], Slot[3]]]]],
Function[List[Slot[1], n, Length[Slot[1]]]]
[cycleLists]], 1]]]],
Null]
----------------------------------------
Okie, another one, wee!
ColoredLatticeNetwork[n:(4 | 3), m_Integer,
colors:{_List..}, s_, a_, {x_, y_}] :=3D
Module[{lines, gp}, lines =3D (Map[Line, #1, {2}] & )[
(Partition[#1, 2, 1] & ) /@
N[Table[{1, 0}*s*i + ({Cos[#1], Sin[#1]} & )[
(2*Pi)/n]*s*j, {j, -m, m}, {i, -m, m}]]];
gp =3D (Transpose[#1, {3, 1, 2}] & )[
{cycledMatrix[{m*2, m*2 + 1}, (RotateRight[#1, m] & )[
(RotateRight[#1, m] & ) /@ colors]], lines}];
Translate2DGraphics[{x, y}][
Table[Rotate2DGraphics[{0, 0}, ((2*Pi)*i)/n + a][
gp], {i, 0, n - 1}]]];
Here's the equivalent lispy form lisp morons insist it is easier to
read:
CompoundExpression[
SetDelayed[
ColoredLatticeNetwork[Pattern[n, Alternatives[4, 3]],
Pattern[m, Blank[Integer]],
Pattern[colors, List[Repeated[Blank[List]]]], Pattern[s,
Blank[]],
Pattern[a, Blank[]], List[Pattern[x, Blank[]], Pattern[y,
Blank[]]]],
Module[List[lines, gp],
CompoundExpression[
Set[lines,
Function[Map[Line, Slot[1], List[2]]][
Map[Function[Partition[Slot[1], 2, 1]],
N[Table[
Plus[Times[List[1, 0], s, i],
Times[Function[List[Cos[Slot[1]], Sin[Slot[1]]]]
[
Times[Times[2, Pi], Power[n, -1]]], s, j]],
List[j, Times[-1, m], m], List[i, Times[-1, m],
m]]]]]],
Set[gp, Function[Transpose[Slot[1], List[3, 1, 2]]][
List[cycledMatrix[List[Times[m, 2], Plus[Times[m, 2],
1]],
Function[RotateRight[Slot[1], m]][
Map[Function[RotateRight[Slot[1], m]], colors]]],
lines]]],
Translate2DGraphics[List[x, y]][
Table[Rotate2DGraphics[List[0, 0],
Plus[Times[Times[Times[2, Pi], i], Power[n, -1]], a]]
[gp],
List[i, 0, Plus[n, -1]]]]]]], Null]
--------------------------------
Okie, this one is a simple one.
StarMotif[n_Integer, coords_?MatrixQ, s_, =CE=B1_, {x_, y_}] :=3D
Polygon@(Flatten[#, 1] &)@
Transpose@
Map[Table[{Cos[t + Last@#], Sin[t + Last@#]}*First[#]*s +
{x,
y}, {t, =CE=B1, 2*Pi + =CE=B1 - 2*Pi/n/2, 2*Pi/n}] &,
coords];
Now, the easier-to-read lisp form follows:
CompoundExpression[
SetDelayed[
StarMotif[Pattern[n, Blank[Integer]],
PatternTest[Pattern[coords, Blank[]], MatrixQ], Pattern[s,
Blank[]],
Pattern[=CE=B1, Blank[]],
List[Pattern[x, Blank[]], Pattern[y, Blank[]]]],
Polygon[Function[Flatten[Slot[1], 1]][
Transpose[
Map[Function[
Table[Plus[
Times[List[Cos[Plus[t, Last[Slot[1]]]],
Sin[Plus[t, Last[Slot[1]]]]], First[Slot[1]],
s],
List[x, y]],
List[t, =CE=B1,
Plus[Times[2, Pi], =CE=B1,
Times[-1,
Times[2,
Times[Times[Pi, Power[n, -1]], Power[2,
-1]]]]],
Times[2, Times[Pi, Power[n, -1]]]]]], coords]]]]],
Null]
--------------
This one is semantically and geometrically complex!
SlitLine[Line[pts_List /; (Length@pts > 2)], cuttingLine : {{_, _},
{_, _}}] :=3D
Module[{temp},
If[SameQ @@ (temp =3D PointOnLeftSideQ[#, cuttingLine] & /@ pts),
Return@List@Line@pts];
temp =3D MapThread[
And[#1, #2] &, {(UnsameQ @@ # &) /@
Partition[temp, 2,
1], (PointOnLeftSideQ[First@cuttingLine, #] =3D!=3D
PointOnLeftSideQ[Last@cuttingLine, #] &) /@
Partition[pts, 2, 1]}];
temp =3D Append[#, Null] &@
MapThread[
If[#2, 0@LineIntersectionPoint[#1, cuttingLine],
Null] &, {Partition[pts, 2, 1], temp}];
temp =3D (DeleteCases[#, Null, {1}] &)@Flatten[Transpose@{pts, temp},
1];
(Line /@
ReplaceRepeated[
List@temp, {a__, 0[pt_], b__} :> Sequence[{a, pt}, {pt,
b}]])]
Now, the spectacular lisp form:
SetDelayed[
SlitLine[Line[
Condition[Pattern[pts, Blank[List]], Greater[Length[pts],
2]]],
Pattern[cuttingLine,
List[List[Blank[], Blank[]], List[Blank[], Blank[]]]]],
Module[List[temp],
CompoundExpression[
If[Apply[SameQ,
Set[temp,
Map[Function[PointOnLeftSideQ[Slot[1], cuttingLine]],
pts]]],
Return[List[Line[pts]]]],
Set[temp,
MapThread[Function[And[Slot[1], Slot[2]]],
List[Map[Function[Apply[UnsameQ, Slot[1]]],
Partition[temp, 2, 1]],
Map[Function[
UnsameQ[PointOnLeftSideQ[First[cuttingLi
ne],
Slot[1]],
PointOnLeftSideQ[Last[cuttingLine], Slot[1]]]],
Partition[pts, 2, 1]]]]],
Set[temp,
Function[Append[Slot[1], Null]][
MapThread[
Function[
If[Slot[2], 0[LineIntersectionPoint[Slot[1],
cuttingLine]],
Null]], List[Partition[pts, 2, 1], temp]]]],
Set[temp,
Function[DeleteCases[Slot[1], Null, List[1]]][
Flatten[Transpose[List[pts, temp]], 1]]],
Map[Line,
ReplaceRepeated[List[temp],
RuleDelayed[
List[Pattern[a, BlankSequence[]], 0[Pattern[pt,
Blank[]]],
Pattern[b, BlankSequence[]]],
Sequence[List[a, pt], List[pt, b]]]]]]]]
If you want to see more, you can download my package at
http://xahlee.org/MathGraphicsGalle...emo_dir/planeT=
ilingPackageDemo.html
Free of charge.
Xah
xah@xahlee.org
=E2=88=91 http://xahlee.org/
| |
| Malcolm McLean 2007-05-05, 8:02 am |
|
"Miles Bader" <miles@gnu.org> wrote in message
news:873b2cxbxt.fsf@catnip.gol.com...
> "Robert D. Crawford" <rdc1x@comcast.net> writes:
>
> Xahlee likes to complain. That's the main factor here.
>
There is thought and intelligence in his posts. However they are provocative
in both the good and the bad sense of the term, and rather eccentric.
--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm
| |
| Malcolm McLean 2007-05-05, 8:02 am |
|
"Kaz Kylheku" <kkylheku@gmail.com> wrote in message
news:1178325041.606260.94840@w5g2000hsg.googlegroups.com...
On May 4, 5:11 pm, Xah Lee <x...@xahlee.org> wrote:
>
>Programming language syntax shouldn't be natural for humans to read.
>Or, rather, this shouldn't be a requirement which creates technical
>compromises.
>
I couldn't disagree more. Occasionally you do need to use a language with no
technical compromises whatsoever - pure assembly or machine code - but only
rarely. Most of the time we accept some limitations for the sake of making
things easier for the human programmer. That includes run-time efficiency,
but also restrictions in the "power" of the language.
You might be interested in the page 10 Rules of Computer Programming on my
website which deals with psychological issues in programming. Lisp breaks
the rule of three in spades.
--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm
| |
| Pascal Costanza 2007-05-05, 8:02 am |
| Xah Lee wrote:
> How Lisp's Nested Notation Limits The Language's Utility
>
> Xah Lee, 2007-05-03
>
> There is a common complain by programers about lisp's notation, of
> nested parenthesis, being unnatural or difficult to read. Long time
> lisp programers, often counter, that it is a matter of conditioning,
> and or blaming the use of “inferior” text editors that are not
> designed to display nested notations. In the following, i describe how
> lisp notation is actually a problem, in several levels.
>
> (1) Some 99% of programers are not used to the nested parenthesis
> syntax. This is a practical problem. On this aspect along, lisp's
> syntax can be considered a problem.
Lisp doesn't have a problem here. Lisp is a programming language, an
inanimate, dispassionate, virtual concept which doesn't (cannot!) "care"
whether it is used at all.
Only people can have problems with something. For example, programmers
who want some of the features of Lisp but don't want to put up with
its syntax.
However, for decades, there have been programmers who have learned to
prefer Lisp's syntax over anything else. As long as they continue to
exist, Lisp dialects will continue to exist. Those people don't have a
problem - to the contrary.
Leave them alone - they are happy with their choice.
If you don't like Lisp, there are numerous attempts to copy its features
using other surface syntaxes. Just pick one.
Pascal
--
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/
| |
| Markus E Leypold 2007-05-05, 8:02 am |
|
"Malcolm McLean" <regniztar@btinternet.com> writes:
> "Miles Bader" <miles@gnu.org> wrote in message
> news:873b2cxbxt.fsf@catnip.gol.com...
> There is thought and intelligence in his posts. However they are
> provocative in both the good and the bad sense of the term, and rather
Where is the good sense in there? We have (at c.l.f) people
complaining about parenthesis in lisp every 3 months and the arguments
never get any better or new. Rehashing all that once again doesn't
attest to "thought and intelligence" but rather to a trollish streak.
Regards -- Markus
| |
| Markus E Leypold 2007-05-05, 8:02 am |
|
Rayiner Hashem <rayiner@gmail.com> writes:
>
> The first time I saw graph-theory notation, I thought it was
> gibberish. I still think most mathematical notation is gibberish, but
> I deal with it --- I don't turn in proofs written in prose.
Right.
>
And BTW, it's not natural for humans to read at all.
:-)
[color=darkred]
>
> And mathematical notation is not natural for people to read, at least
> not anybody who grew up learning a natural language. But people deal
> with it. They're remarkably adaptable this way.
Regards -- Markus
| |
| Miles Bader 2007-05-05, 8:02 am |
| Markus E Leypold
<development-2006-8ecbb5cc8aREMOVETHIS@ANDTHATm-e-leypold.de> writes:
> Where is the good sense in there? We have (at c.l.f) people
> complaining about parenthesis in lisp every 3 months and the arguments
> never get any better or new. Rehashing all that once again doesn't
> attest to "thought and intelligence" but rather to a trollish streak.
Indeed, and people have been saying what Xahlee's saying since the
_1950s_! Lisp still has the parens, and there are good reasons for that.
-Miles
--
[|nurgle|] ddt- demonic? so quake will have an evil kinda setting? one that
will make every christian in the world foamm at the mouth?
[iddt] nurg, that's the goal
| |
| Miles Bader 2007-05-05, 8:02 am |
| "Malcolm McLean" <regniztar@btinternet.com> writes:
> You might be interested in the page 10 Rules of Computer Programming on
> my website which deals with psychological issues in programming. Lisp
> breaks the rule of three in spades.
That suggests that the "rule of three" is wrong...
-Miles
--
o The existentialist, not having a pillow, goes everywhere with the book by
Sullivan, _I am going to spit on your graves_.
| |
| Markus E Leypold 2007-05-05, 7:04 pm |
|
"Malcolm McLean" <regniztar@btinternet.com> writes:
> You might be interested in the page 10 Rules of Computer Programming
> on my website which deals with psychological issues in
> programming. Lisp breaks the rule of three in spades.
Rule three is about indirection, not about nesting. The other rules
suck also. If your "Refutation of Common Atheist Arguments" have a
similar quality, the atheists will have a field day.
Regards -- Markus
| |
| Anton van Straaten 2007-05-05, 7:04 pm |
| Markus E Leypold wrote:
> "Malcolm McLean" <regniztar@btinternet.com> writes:
>
>
>
>
> Rule three is about indirection, not about nesting. The other rules
> suck also. If your "Refutation of Common Atheist Arguments" have a
> similar quality, the atheists will have a field day.
Perhaps it's not a coincidence that these two seemingly unrelated
arguments are offered by the same person. Both religious belief and a
belief in the essential importance of syntactic sugar require abandoning
Occam's Razor.
Anton
| |
| Xah Lee 2007-05-05, 7:04 pm |
| Dear Pascal moron,
Xah Lee wrote:
=C2=AB (1) Some 99% of programers are not used to the nested parenthesis
syntax. This is a practical problem. On this aspect along, lisp's
syntax can be considered a problem.=C2=BB
Pascal Costanza wrote:
=C2=ABLisp doesn't have a problem here. Lisp is a programming language, an
inanimate, dispassionate, virtual concept which doesn't (cannot!)
"care" whether it is used at all. Only people can have problems with
something. For example, programmers who want some of the features
of Lisp but don't want to put up with its syntax. =C2=BB
You are actually wrong here, because, people can't have a problem.
People are animals, made of meat. They can have a problem when, they
get sick, and their body will disfunction or function abnormally. So,
for example, even sexp has all the problems, lisp morons are still
fine.
Pascal XXXXhead wrote:
=C2=ABHowever, for decades, there have been programmers who have learned to
prefer Lisp's syntax over anything else. As long as they continue to
exist, Lisp dialects will continue to exist. Those people don't have a
problem - to the contrary.=C2=BB
existence?
my god... you are quite desperate.
In this thread, a few people already started to post completely off
topic, brainless, pure personal attacks. I think you are still good.
Sometimes i have a problem telling, of those who post brainless things
to my articles, whether they are joking with wanton carelessness, or
if their critical thinking abilities is really that low.
For example, your reply is a good example. I wasn't sure, if you are
just XXXXing with me, or really, really meant your writing as a valid
argument to my thesis. In this thread, Ken Tilton, also wrote
something that's incredibly stupid. In fact, more or less repeating
what i said, just with antagonism and explicit denial. I take it, that
he acted that way probably because my essay is so cogent and powerful
that it hit a nerve and paralyzed his reasoning faculties and numbed
his nonchalant quip Muse.
There are some others in this thread, which are so hateful, XXXXing
full of the ugliness of humanity. The replies from Markus E Leypold is
a prime example. I wonder, outside of newsgroups, if he is just a
sophomoron at college.
Other posts in this thread, some sincere ones, are full utterly
XXXXing stupid drivels. (or i shall put the polite version: logical
fallacies) The level is so low that i'm really ashamed that they
really came out from the mouthes of a class of people in society who's
jobs are to program computers.
(in this regard, see:
The Condition of Industrial Programers
http://xahlee.org/UnixResource_dir/...programers.html
)
For example, there's this gem: =C2=ABProgramming language syntax shouldn't
be natural for humans to read. Or, rather, this shouldn't be a
requirement which creates technical compromises.=C2=BB
I think this quote or the concept of it has been around for a while.
If you take it seriously, it's full of MOTHERXXXXING nonsensical,
meaningless, shit. It amounts to a sound bite. Behind it, it wants to
make programers, in particular the elite programers like the lisp
XXXXers, to think something along the line: =E2=80=9Cmy syntax is so bizarre
because i'm superior=E2=80=9D.
I guess it's lisper's version of =E2=80=9CThe three chief virtues of a
programmer are: Laziness, Impatience and Hubris=E2=80=9D.
Pascal Costanza moron wrote:
=C2=ABLeave them alone - they are happy with their choice. =C2=BB
=C2=ABIf you don't like Lisp, there are numerous attempts to copy its
features
using other surface syntaxes. Just pick one. =C2=BB
Try, perhaps, learn to calm down yourself. You are not under attack.
Lisp the language, is not under attack by my essay. My article,
although cogently detailed why lisp syntax is a serious problem at
several levels, it does not mean that, it is =E2=80=9Cno good=E2=80=9D in s=
ome
absolute way. Also, it is far better, then essentially all imperative
language's syntaxes. Even, one can logically agree with my article,
and remain positive, because although lisp perhaps reduce the use of
function sequencing, but that by itself is not necessarily a very bad
thing. Because, function sequencing (aka chaining), although a very
important paradigm, is not necessarily the only way to program, nor
the only way for functional programing. Consider, even today in the
light of OOP. And Common Lisp, in particular, isn't all that much
concerned about purity of functional programing anyway. So logically,
from this perspective or argument, my essay isn't a damning
certificate.
I'm really sorry i have to say the above paragraph, as if like a pat
on the back to some crying pussies. But the juvenility, sensitivity,
ignorance, and stupidity, as shown in the responses in this thread,
made me.
I was hoping, perhaps due to my clear exposition of the sexp problem
for perhaps the first time, that we could move on to other fruitful
discussions, not necessarily agree that it is a problem. For example,
LOGO, DyLan, Arc all abandoned the nested XXXX. I mean, lispers may
disagree, but the people behind these LISP languages are not brainless
XXXXheads, are they? Alternatively, i was hoping, perhaps there will
be fruitful discussions in the direction of technical issues of
transforming syntax. i.e. of Mathematica's f[a,b] and lisp's (f a b).
Or, perhaps some technically knowledgable people here (there are many)
can by ways of chat, impart some insight about some technical
connections between syntaxes and semantic (apart from myself). For
example, DyLan i believe once was believed to have have sexp
underneath. If so, that would be interesting because it gives us a
actual, existing, example of a lang with sexp underneath alternative
to Mathematica's ways. But also, lisp can actually relatively easily,
create a layer of syntax on top of sexp...
Really, you people need to learn. Be calm. Keep your mind open. I'm
not attacking you or attacking lisp. If there's any attacking, it is
your immature and unhealthy nerve.
PS By the way, i also responded a article recently about why Perl and
Python programers today should learn lisp.
(
=E2=80=9CWhy learn lisp when there are python and perl?=E2=80=9D, Xah Lee, =
2007-05-03.
http://xahlee.org/UnixResource_dir/writ/wl_lisp.html
)
Can a lisper write a open letter thanking me for that please?
Xah
xah@xahlee.org
=E2=88=91 http://xahlee.org/
| |
| Tim Bradshaw 2007-05-05, 7:04 pm |
| On May 5, 1:11 am, Xah Lee <x...@xahlee.org> wrote:
> How Lisp's Nested Notation Limits The Language's Utility
Very good. Now, off you go and design and implement an alternative
syntax. It's easy, it's been done hundreds of times. I think I have
two or three limited examples on my web site and several more I never
bothered publishing. There must, as I say, be hundreds of examples
around and probably thousands when you count all the non-published
ones. So pick the best and use them, or, since you're by far the
smartest person here, why not come up with your own? Jon Harrop can
probably help you.
| |
| Mark Tarver 2007-05-05, 7:04 pm |
| I think *you* need to down Xah Lee. I agree it can be annoying
if you make a critical analysis of Lisp and people attack *you*. This
is called an ad hominem argument, and, ly, they are all too common
on usenet. But calling people names like 'moron' is not the right
way to win hearts and minds. You say some interesting things but you
play into the hands of your critics by launching personal attacks.
Now you will probably get a load more posts attacking your bad manners
and so your original points are lost in the scrum and people write you
off as a troll.
Be and if you do think someone is using ad hominem arguments;
tersely point it out and return to the main points. Don't get
abusive.
Mark
On 5 May, 16:52, Xah Lee <x...@xahlee.org> wrote:
> Dear Pascal moron,
>
> Xah Lee wrote:
>
> =C2=A0=C2=AB (1) Some 99% of programers are not used to the nested parent=
hesis
> syntax. This is a practical problem. On this aspect along, lisp's
> syntax can be considered a problem.=C2=BB
>
> Pascal Costanza wrote:
>
> =C2=ABLisp doesn't have a problem here. Lisp is a programming language, an
> inanimate, dispassionate, virtual concept which doesn't (cannot!)
> "care" whether it is used at all. =C2=A0Only people can have problems with
> something. For example, programmers who want some of the features
> of Lisp but don't want to put up with its syntax. =C2=BB
>
> You are actually wrong here, because, people can't have a problem.
> People are animals, made of meat. They can have a problem when, they
> get sick, and their body will disfunction or function abnormally. So,
> for example, even sexp has all the problems, lisp morons are still
> fine.
>
> Pascal XXXXhead wrote:
>
> =C2=ABHowever, for decades, there have been programmers who have learned =
to
> prefer Lisp's syntax over anything else. As long as they continue to
> exist, Lisp dialects will continue to exist. Those people don't have a
> problem - to the contrary.=C2=BB
>
> existence?
>
> my god... you are quite desperate.
>
> In this thread, a few people already started to post completely off
> topic, brainless, pure personal attacks. I think you are still good.
>
> Sometimes i have a problem telling, of those who post brainless things
> to my articles, whether they are joking with wanton carelessness, or
> if their critical thinking abilities is really that low.
>
> For example, your reply is a good example. I wasn't sure, if you are
> just XXXXing with me, or really, really meant your writing as a valid
> argument to my thesis. In this thread, Ken Tilton, also wrote
> something that's incredibly stupid. In fact, more or less repeating
> what i said, just with antagonism and explicit denial. I take it, that
> he acted that way probably because my essay is so cogent and powerful
> that it hit a nerve and paralyzed his reasoning faculties and numbed
> his nonchalant quip Muse.
>
> There are some others in this thread, which are so hateful, XXXXing
> full of the ugliness of humanity. The replies from Markus E Leypold is
> a prime example. I wonder, outside of newsgroups, if he is just a
> sophomoron at college.
>
> Other posts in this thread, some sincere ones, are full utterly
> XXXXing stupid drivels. (or i shall put the polite version: logical
> fallacies) The level is so low that i'm really ashamed that they
> really came out from the mouthes of a class of people in society who's
> jobs are to program computers.
>
> (in this regard, see:
> The Condition of Industrial Programershttp://xahlee.org/UnixResource_dir/=
writ/it_programers.html
> )
>
> For example, there's this gem: =C2=ABProgramming language syntax shouldn't
> be natural for humans to read. Or, rather, this shouldn't be a
> requirement which creates technical compromises.=C2=BB
>
> I think this quote or the concept of it has been around for a while.
> If you take it seriously, it's full of MOTHERXXXXING nonsensical,
> meaningless, shit. It amounts to a sound bite. Behind it, it wants to
> make programers, in particular the elite programers like the lisp
> XXXXers, to think something along the line: =E2=80=9Cmy syntax is so biza=
rre
> because i'm superior=E2=80=9D.
>
> I guess it's lisper's version of =E2=80=9CThe three chief virtues of a
> programmer are: Laziness, Impatience and Hubris=E2=80=9D.
>
> Pascal Costanza moron wrote:
>
> =C2=ABLeave them alone - they are happy with their choice. =C2=BB
>
> =C2=ABIf you don't like Lisp, there are numerous attempts to copy its
> features
> using other surface syntaxes. Just pick one. =C2=BB
>
> Try, perhaps, learn to calm down yourself. You are not under attack.
> Lisp the language, is not under attack by my essay. My article,
> although cogently detailed why lisp syntax is a serious problem at
> several levels, it does not mean that, it is =E2=80=9Cno good=E2=80=9D in=
some
> absolute way. Also, it is far better, then essentially all imperative
> language's syntaxes. Even, one can logically agree with my article,
> and remain positive, because although lisp perhaps reduce the use of
> function sequencing, but that by itself is not necessarily a very bad
> thing. Because, function sequencing (aka chaining), although a very
> important paradigm, is not necessarily the only way to program, nor
> the only way for functional programing. Consider, even today in the
> light of OOP. And Common Lisp, in particular, isn't all that much
> concerned about purity of functional programing anyway. So logically,
> from this perspective or argument, my essay isn't a damning
> certificate.
>
> I'm really sorry i have to say the above paragraph, as if like a pat
> on the back to some crying pussies. But the juvenility, sensitivity,
> ignorance, and stupidity, as shown in the responses in this thread,
> made me.
>
> I was hoping, perhaps due to my clear exposition of the sexp problem
> for perhaps the first time, that we could move on to other fruitful
> discussions, not necessarily agree that it is a problem. For example,
> LOGO, DyLan, Arc all abandoned the nested XXXX. I mean, lispers may
> disagree, but the people behind these LISP languages are not brainless
> XXXXheads, are they? Alternatively, i was hoping, perhaps there will
> be fruitful discussions in the direction of technical issues of
> transforming syntax. i.e. of Mathematica's f[a,b] and lisp's (f a b).
> Or, perhaps some technically knowledgable people here (there are many)
> can by ways of chat, impart some insight about some technical
> connections between syntaxes and semantic (apart from myself). For
> example, DyLan i believe once was believed to have have sexp
> underneath. If so, that would be interesting because it gives us a
> actual, existing, example of a lang with sexp underneath alternative
> to Mathematica's ways. But also, lisp can actually relatively easily,
> create a layer of syntax on top of sexp...
>
> Really, you people need to learn. Be calm. Keep your mind open. I'm
> not attacking you or attacking lisp. If there's any attacking, it is
> your immature and unhealthy nerve.
>
> PS By the way, i also responded a article recently about why Perl and
> Python programers today should learn lisp.
> (
> =E2=80=9CWhy learn lisp when there are python and perl?=E2=80=9D, Xah Lee=
, 2007-05-03.
> =C2=A0http://xahlee.org/UnixResource_dir/writ/wl_lisp.html
> )
>
> Can a lisper write a open letter thanking me for that please?
>
> =C2=A0 Xah
> =C2=A0 x...@xahlee.org
> =E2=88=91http://xahlee.org/
| |
| Malcolm McLean 2007-05-05, 7:04 pm |
|
"Anton van Straaten" <anton@appsolutions.com> wrote in message
news:WI1%h.2620$RX.788@newssvr11.news.prodigy.net...
> Markus E Leypold wrote:
>
> Perhaps it's not a coincidence that these two seemingly unrelated
> arguments are offered by the same person. Both religious belief and a
> belief in the essential importance of syntactic sugar require abandoning
> Occam's Razor.
>
I can't defend 12 Common Atheist Arguments (refuted) here, for obvious
reasons, without irritating a lot of Lispers.
A programming language is inherently a compromise between the needs of the
human programmer and the needs of the computer. That's why the 10 rules of
computer programming are all psychological rules. There are many other
things you need to know to program a computer, but they are documented with
the system. The difference is, if you break a psychological rule then the
program still works, but it is too difficult to maintain.
The rules are also ones which people might be tempted to break - obviously
writing code with no comments and one letter identifiers is a bad idea, but
people don't need to be told that, so it's not a rule.
The rule of three was written before I was familiar with Lisp, and so you
might say that Lisp is a counter-example. I don't think it is, because the
first thing that everyone says about Lisp is "I can't do with all those
parentheses". In fact Lisp programmers use indentation to try to impose
another hierarchy of structure on the program, something they wouldn't need
to do if humans could glance at a long expression and match up parentheses.
--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm
| |
| Malcolm McLean 2007-05-05, 7:04 pm |
|
"Xah Lee" <xah@xahlee.org> wrote in message
news:1178380349.870563.248550@l77g2000hsb.googlegroups.com...
>For example, there's this gem: «Programming language syntax shouldn't
>be natural for humans to read. Or, rather, this shouldn't be a
>requirement which creates technical compromises.»
>I think this quote or the concept of it has been around for a while.
>If you take it seriously, it's full of --------- nonsensical,
>meaningless, ----. It amounts to a sound bite. Behind it, it wants to
>make programers, in particular the elite programers like the lisp
>-----, to think something along the line: “my syntax is so bizarre
>because i'm superior”.
>
Now I also disagreed with Kaz on that one. Compare my post with yours. and
consider why I had to delete some many words in quoting you. Who do you
think is more likely to convince Mr Kylheku that he is in error?
--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm
| |
| Xah Lee 2007-05-05, 7:04 pm |
| Mark Tarver wrote:
=C2=ABI think *you* need to down Xah Lee. I agree it can be annoying
if you make a critical analysis of Lisp and people attack *you*. This
is called an ad hominem argument, and, ly, they are all too common
on usenet. ...=C2=BB
=C2=ABBut calling people names like 'moron' is not the right way to win
hearts and minds....=C2=BB
Exactly. I've been using online forums since 1990. I've been using
newsgroups since maybe 1994. If i wanted to play politics, given my IQ
and my knowledge of computing, and great skill of composition, i might
be a XXXXnig George Bush by now, with a massive army of morons at my
commands, not like, the likes of some computing industry leaders.
Understand, politness, is a intrinsic element of politics. (and
politics, means power-struggle) Politness arose from the existance of
hostility and aggression. Without aggression, there is no politness.
One easy way to see this, is notice how the behavior of politeness is
inversly proportional to how close are the parties involved. There
will be little politness, between your sisters, wives, or parents.
There will be a huge politeness, when big stakes are involved between
unbound human animals.
The computing newsgroups, made of males, have been brawling just about
when it begin. Your few words on politness and lecturing, is one
additional off-topic drivel in its history. (though, i appreciate your
kindness and your knowledge)
In this thread, i did not start four-letter words before NUMEROUS
XXXXheads began sprouting purely unreasonable, totally off-topic,
personal attacks on me in a way more serious than name calling.
(because, it smacks of witch-hunting) (they naturally did this,
because they perceived that i =E2=80=9Cattacked=E2=80=9D their computer lan=
guage. This
is because, the computing language newsgroup tech g ers are utterly
ignorant of sociology, and combined with male power struggling
instict, have habored the thought about =E2=80=9Ctrolling=E2=80=9D, and som=
e ethical
ideas about what one can or cannot say about other's computer
languages. Utterly bizarre.)
This doesn't happen to just me. It just a normal day in newsgroups.
Whoever, may it be professor, or eminent mathematician, professinoal
senior programers (as many are here), as long as he is a long time
newsgroup user, may have involved in verbal abuses given or taken.
(and each party are fully aware the other's social standings, but it
does'n matter. (e.g. in this very thread, a few started to gang up on
Jon Harrop, who is a author of a few functional language books)) It
is, the culture of newsgroups, so to speak. In a way, it is how people
WANT newsgroups to be the way it is. You knew it, i knew it, and we
should not deny it. If you are concerned about this state of affairs
of newsgroups, you need to rethink about it. Not the same old
instinctive good intentions. George motherXXXXing Bush has good
intentions and 50k to 300k Islamic civilians are dead. I'm sure you
are a kind man. Thousands of kind men existed in newsgroups before
you. They all have, at one time or another or more, given kind
advices, and contributed to what newsgroup is today.
I recommend a few articles. These articles, if tech g rs all read
it, will help improve the state of affairs of newsgroups.
=E2=80=A2 What Desires are Politically Important? by Bertrand Russell
http://xahlee.org/Periodic_dosage_d...ll-lecture.html
=E2=80=A2 Demonic Males. Apes and the Origins of Human Violence.
By Richard Wrangham and Dale Peterson
http://xahlee.org/p/demonic_males.html
Nice meeting you.
Xah
xah@xahlee.org
=E2=88=91 http://xahlee.org/
| |
| Jon Harrop 2007-05-05, 7:04 pm |
| Pascal Costanza wrote:
> Leave them alone - they are happy with their choice.
No. No, they aren't. The Lisp community are actually more interested in
other languages than almost all other programming language communities.
This is why I continue to post in c.l.l, because it garners a lot of
interest in my work from the many Lisp users who are still looking for
something better.
--
Dr Jon D Harrop, Flying Frog Consultancy
The F#.NET Journal
http://www.ffconsultancy.com/produc...journal/?usenet
| |
| David Kastrup 2007-05-05, 7:04 pm |
| Mark Tarver <dr.mtarver@ukonline.co.uk> writes:
> I think *you* need to down Xah Lee. I agree it can be annoying
> if you make a critical analysis of Lisp and people attack *you*.
> This is called an ad hominem argument, and, ly, they are all too
> common on usenet. But calling people names like 'moron' is not the
> right way to win hearts and minds. You say some interesting things
> but you play into the hands of your critics by launching personal
> attacks.
"play" is actually not the four-letter word I would have used here.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
| |
| andrew.baine@gmail.com 2007-05-05, 10:05 pm |
|
> Other posts in this thread, some sincere ones, are full utterly
> XXXXing stupid drivels. (or i shall put the polite version: logical
> fallacies) The level is so low that i'm really ashamed that they
> really came out from the mouthes of a class of people in society who's
> jobs are to program computers.
>
> (in this regard, see:
> The Condition of Industrial Programershttp://xahlee.org/UnixResource_dir/writ/it_programers.html
> )
>
When Xah Lee cites to his website, it reminds me of Ignatius J. Reilly
citing his own work in Toole's "A Confederacy of Dunces:"
--- excerpt ---
The humble and pious peasant, Piers Plowman, went to town to sell his
children to the lords of the New Order for purposes that we may call
questionable at best. (See Reilly, Ignatius J., _Blood on Their
Hands: The Crime of It All, A study of some selected abuses in
sixteenth-century Europe_, a Monograph, 2 pages, 1950, Rare Book Room,
Left Corridor, Third Floor, Howard-Tilton Memorial Library, Tulane
University, New Orleans 18, Louisiana. Note: I mailed this singular
monograph to the library as a gift; however, I am not really certain
that it was ever accepted. It may well have been thrown out because
it was only written in pencil on tablet paper.)
--- end excerpt --
Ken, are you related to the Tilton who founded the library
mentioned?
Interestingly enough, Ignatius J. Reilly clearly was not put off by
parentheses, as he nests them throughout his writings. This is one
reason I recommend "A Confederacy of Dunces" to people learning Lisp,
though I still feel Practical Common Lisp is the best for total
newbies.
OK, sorry to distract from the main line here.
Best,
Andrew
| |
|
| Tim Bradshaw <tfb+google@tfeb.org> writes:
> On May 5, 1:11 am, Xah Lee <x...@xahlee.org> wrote:
>
> Very good. Now, off you go and design and implement an alternative
> syntax. It's easy, it's been done hundreds of times. I think I have
> two or three limited examples on my web site and several more I never
> bothered publishing. There must, as I say, be hundreds of examples
> around and probably thousands when you count all the non-published
> ones. So pick the best and use them, or, since you're by far the
> smartest person here, why not come up with your own? Jon Harrop can
> probably help you.
>
Actually, I think this is a very good idea for Xah. Many have been very
critical of what he posts (including myself), but I suspect a large percentage
of people totally dismiss what he writes because he doesn't provide any
constructive alternatives. He regularly posts about what is wrong with emacs,
lisp, unix, perl etc. but rarely do I see any proposed solutions or
constructive ideas that might actually improve the situation.
come on Xah, you have made frequent references to your superior IQ, your
ability to write and express ideas. Its easy to moan about whats wrong with the
world, time to put your money where your mouth is. Take some of that boundless
IQ and your superior skills in communication and post some ideas on how things
could be improved.
Tim
--
tcross (at) rapttech dot com dot au
| |
| Tim Bradshaw 2007-05-06, 8:02 am |
| On May 6, 5:54 am, Tim X <t...@nospam.dev.null> wrote:
> Take some of that boundless
> IQ and your superior skills in communication and post some ideas on how things
> could be improved.
Don't post ideas, post implementations. It really is very easy to
implement new syntaxes for Lisp.
| |
| Jon Harrop 2007-05-06, 7:03 pm |
| Tim Bradshaw wrote:
> On May 6, 5:54 am, Tim X <t...@nospam.dev.null> wrote:
>
> Don't post ideas, post implementations. It really is very easy to
> implement new syntaxes for Lisp.
The problem isn't creating a syntax (all decent PLs have good syntax). The
problem is that CL doesn't bundle a decent syntax (or pattern matching,
or ...). So there's no point in Xah implementing anything.
--
Dr Jon D Harrop, Flying Frog Consultancy
The F#.NET Journal
http://www.ffconsultancy.com/produc...journal/?usenet
| |
| Arved Sandstrom 2007-05-06, 7:03 pm |
| "Malcolm McLean" <regniztar@btinternet.com> wrote in message
news:TNOdnQlUpMyFqqHbnZ2dnUVZ8sSrnZ2d@bt
.com...
>
> "Kaz Kylheku" <kkylheku@gmail.com> wrote in message
> news:1178325041.606260.94840@w5g2000hsg.googlegroups.com...
> On May 4, 5:11 pm, Xah Lee <x...@xahlee.org> wrote:
> I couldn't disagree more. Occasionally you do need to use a language with
> no technical compromises whatsoever - pure assembly or machine code - but
> only rarely. Most of the time we accept some limitations for the sake of
> making things easier for the human programmer. That includes run-time
> efficiency, but also restrictions in the "power" of the language.
[ SNIP ]
You two are not referring to the same thing. Syntax is not related to the
power of a language (or the lack thereof) in the slightest. Plenty of
languages that operate at higher levels than machine code or assembler are
just as terse and non-intelligible to the uninformed. Kaz simply made a
reference to syntax.
AHS
| |
| Malcolm McLean 2007-05-06, 7:03 pm |
|
"Arved Sandstrom" <asandstrom@accesswave.ca> wrote in message
news:z4o%h.5219$Vi6.3376@edtnps82...
> "Malcolm McLean" <regniztar@btinternet.com> wrote in message
> news:TNOdnQlUpMyFqqHbnZ2dnUVZ8sSrnZ2d@bt
.com...
> [ SNIP ]
>
> You two are not referring to the same thing. Syntax is not related to the
> power of a language (or the lack thereof) in the slightest. Plenty of
> languages that operate at higher levels than machine code or assembler are
> just as terse and non-intelligible to the uninformed. Kaz simply made a
> reference to syntax.
>
If we use the term "syntax" in the narrow sense then Kaz's statement is
nonsense, because syntax is simply the convention for noting the grammar.
For instance we could use "begin" and "end" instead of '(' and ')' to open
and close lists, without changing anything fundamental about the language,
but it wouldn't be a good idea because it would be totally unreadable. A
change in syntax inherently can't create technical compromises, unless I
suppose you demand a symbol like $ which might not be available on some
machines.
If we use it in the broader sense then we've got something to argue about.
Let's say that we agree that add(1, 2, 3) is easier to read than (add 1 2
3), and we change the underlying representation so that "function calls" are
separate from "lists". Now we've made the language less tidy at the machine
level, but we've also given an advantage to the human programmer. There is
no easy or "right" answer to these questions. My own programming language,
MiniBasic (see website) makes huge technical compromises, such as having
only one numerical type, to make the language easier to learn, because that
is the priority.
--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm
| |
| Joe Marshall 2007-05-06, 7:03 pm |
| On May 4, 5:11 pm, Xah Lee <x...@xahlee.org> wrote:
> How Lisp's Nested Notation Limits The Language's Utility
>
> Xah Lee, 2007-05-03
>
> There is a common complain by programers about lisp's notation, of
> nested parenthesis, being unnatural or difficult to read. Long time
> lisp programers, often counter, that it is a matter of conditioning,
> and or blaming the use of "inferior" text editors that are not
> designed to display nested notations. In the following, i describe how
> lisp notation is actually a problem, in several levels.
I think you're wrong, Xah. If the syntax is a problem, why haven't
any alternative syntaxes taken over for s-expressions? I point to
these examples:
M-Expressions (c. 1962)
maplist[x;fn]=[null[x]->NIL;
T->cons [fn[x];maplist [cdr [x];fn]]]
CGOL (c. 1977)
define "CGMAP"(x, inon, disp, typ);
if atom car x or caar x not isin !'(quote function)
or if atom cadar x then typ ne "mapcar" else caadar x ne "LAMBDA"
then (princ typ; let lbd=0, rbd=0; cglist(x, ", ", 0, 0))
else if atom cadar x and typ = "mapcar" then
(cgolprin2(cadar x, lbd, rbd, depth);
princ "["; let lbd=-1, rbd=0;
cglist(cdr x, ", ", 0, 0);
princ "]")
else (printeol;
princ "for ";
for vars on cadr cadar x, argts on cdr x do
(lcprinc car vars;
princ inon;
cgolprin2(car argts, 2, 0, depth+1);
if cdr vars then princ ", ");
princ disp;
let depth = depth+1; printeol;
cglist(cddr cadar x, "; ", 1, 0)) $
Dylan (c. 1990)
define function find-position-and-velocity
(rock :: <rock>, time :: <float> )
=> (position :: <float>, velocity :: <float> )
values(-4.9 * time * time
+ rock.initial-velocity * time
+ rock.initial-position,
-9.8 * time
+ rock.initial-velocity);
end function;
Curl (late 1990s)
{method public {set-size layout:LayoutContext, rect:GRect}:void
{super.set-size layout, rect}
|| match pixmap size with display
let width:int = ((rect.lextent + rect.rextent) / pixel-length) asa
int
let height:int = ((rect.ascent + rect.descent) / pixel-length) asa
int
set self.current-pixmap = {Pixmap width, height, ignore-alpha?
=true}
{self.on-resample}
}
Every year someone comes on comp.lang.lisp and informs us
that it is the parenthesis that are the problem. But in more than
forty years no one has come up with a better alternative, and
it hasn't been for want of trying or lack of imagination.
| |
| Jon Harrop 2007-05-06, 7:03 pm |
| Joe Marshall wrote:
> I think you're wrong, Xah. If the syntax is a problem, why haven't
> any alternative syntaxes taken over for s-expressions?
They have.
Mathematica uses more conventional syntax to handle expressions:
map[{}, _] := {}
map[{h_, t___}, f_] := Prepend[map[{t}, f], f[h]]
or using the built-in map:
f /@ x
For example, squaring the terms of a sum:
In:= #^2& /@ (1 + 3 x + x y)
Out= 1 + 9 x^2 + x^2 y^2
As Xah explained, Mathematica gives you the choice between prefix format
(same properties as Lisp's s-exprs) or more sophisticated syntax. The
latter is far more popular.
OCaml allows you to define infix operators and these can be used to compose
expressions. From the symbolic simplifier example I gave:
let rec ( +: ) f g = match f, g with
| `Q n, `Q m -> `Q (n +/ m)
| `Q (Int 0), e | e, `Q (Int 0) -> e
| f, `Add(g, h) -> f +: g +: h
| f, g -> `Add(f, g)
let rec ( *: ) f g = match f, g with
| `Q n, `Q m -> `Q (n */ m)
| `Q (Int 0), e | e, `Q (Int 0) -> `Q (Int 0)
| `Q (Int 1), e | e, `Q (Int 1) -> e
| f, `Mul(g, h) -> f *: g *: h
| f, g -> `Mul(f, g)
Note that I chose to use infix operators +: and *: to compose expressions. I
could have used prefix syntax but conventional syntax is clearer.
One of the advances made by the F# language (derived from OCaml) is that it
allows operator overloading, so you can use + rather than +: to compose
expressions.
OCaml, MetaOCaml and F# provide quotations, allowing you to generate
expressions from quoted source code.
However, you cannot decompose expressions using a nice syntax:
let rec d f x = match f with
| f + g -> d f x + d g x
| f * g -> f * d g x + g * d f x
| ...
so you must write a macro to extend the pattern matcher in OCaml.
In the future, F# may support overloading infix active patterns (views)
which will provide this functionality from the language itself.
So I think it is fair to say that s-exprs in Lisp have been superceded by
more efficient representations of expressions in most modern FPLs.
--
Dr Jon D Harrop, Flying Frog Consultancy
The F#.NET Journal
http://www.ffconsultancy.com/produc...journal/?usenet
| |
|
|
| Malcolm McLean 2007-05-07, 8:03 am |
| "Joe Marshall" <eval.apply@gmail.com> wrote in message
>
> Every year someone comes on comp.lang.lisp and informs us
> that it is the parenthesis that are the problem. But in more than
> forty years no one has come up with a better alternative, and
> it hasn't been for want of trying or lack of imagination.
>
It's a completely natural first reaction. I am used to languages in which
parentheses are a minor matter used to disambiguate short expressions. So
the first thing you say on seeing a Lisp program is " ".
The second thing I said was "why not write a graphical editor for this, to
show the lists as trees?".
However I haven't written enough Lisp to comment on how best to work with
it.
--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm
| |
| Tim Bradshaw 2007-05-07, 8:03 am |
| On 2007-05-06 17:29:52 +0100, Jon Harrop <jon@ffconsultancy.com> said:
> The problem isn't creating a syntax (all decent PLs have good syntax). The
> problem is that CL doesn't bundle a decent syntax (or pattern matching,
> or ...). So there's no point in Xah implementing anything.
As I mentioned in another article, I really think you do need to learn
about this internet thing. One of the nice features it offers is
something called "downloading" - people can write code which you can
then "download" onto your own computer and run there. It's just
amazingly better than the whole shipping magtapes around thing.
| |
| Xah Lee 2007-05-07, 8:03 am |
| 2007-05-06
=C2=ABI think you're wrong, Xah. If the syntax is a problem, why haven't
any alternative syntaxes taken over for s-expressions? I point to
these examples:=C2=BB
Do you know how fanatics are blind?
For example, there are Christians, and there are Islamics. Doesn't
matter what you say, what logic, what rationality, what patience, what
evidence, for vast majority of these people, God of their variety will
exist, and will be the only type.
Fanatics are fanatics because they lost their rationality on the
subject. They simply have the need to believe. (other examples in the
computing industry include: Mac fanatics, unix XXXXheads (and now
Linux), OpenSource XXXXheads.)
My article, is not titled =E2=80=9CThe stupidity of Lisp Syntax=E2=80=9D. N=
or =E2=80=9CLisp's
got syntax problems=E2=80=9D. Nor, =E2=80=9CThe moronicity of Common Lisp f=
uckheads=E2=80=9D.
The title is =E2=80=9CHow Lisp's Nested Notation Limits The Language's
Utility=E2=80=9D.
Note that it says =E2=80=9CHow=E2=80=9D, meaning, the article is a expositi=
on. Then,
it says =E2=80=9CNested Notation=E2=80=9D. And, it =E2=80=9Climits=E2=80=9D=
.. Limit what? =E2=80=9CLimits the
language's utility=E2=80=9D.
In the article, 3 itemized issues are mentioned. I don't think i
should hold each lisper's hand to go thru the article sentence by
sentence. You can eye the article with built-in Common Lisp prejudice
and come off not reading anything, like basically all lispers who
cried in pain here. These lispers, basically, saw the article, skimmed
it, felt the wound, panics, reactionarily thinking to themselves =E2=80=9CO!
Another Imperative Moron who can't get used to parens!=E2=80=9D, and then l=
ike
a gaggle of ducks, all quack about how sexp is just fine and i'm a
=E2=80=9Ctroll=E2=80=9D.
Joe, i know you are seasoned lisper, and you love lisp. Me too. (But
i'm getting stronger sense everyday that Common Lispers, at least as
so exhibited in comp.lang.lisp are all motherXXXXers, the saboteurs of
the lisp's health.)
In the article, i gave 3 issues. I do not think any lisper can
honestly disagree with any one of them. Note that, let me emphasize
and repeat again here, the conclusion is not: =E2=80=9Clisp's syntax is fuc=
ked
and needs change=E2=80=9D.
(see also my reply to Pascal Costanza, i quote here:
(Try, perhaps, learn to calm down yourself. You are not under attack.
Lisp the language, is not under attack by my essay. My article,
although cogently detailed why lisp syntax is a serious problem at
several levels, it does not mean that, it is =E2=80=9Cno good=E2=80=9D in s=
ome
absolute way. Also, it is far better, then essentially all imperative
language's syntaxes. Even, one can logically agree with my article,
and remain positive, because although lisp perhaps reduce the use of
function sequencing, but that by itself is not necessarily a very bad
thing. Because, function sequencing (aka chaining), although a very
important paradigm, is not necessarily the only way to program, nor
the only way for functional programing. Consider, even today in the
light of OOP. And Common Lisp, in particular, isn't all that much
concerned about purity of functional programing anyway. So logically,
from this perspective or argument, my essay isn't a damning
certificate.)
(I'm really sorry i have to say the above paragraph, as if like a pat
on the back to some crying pussies. But the juvenility, sensitivity,
ignorance, and stupidity, as shown in the responses in this thread,
made me. ) )
Joe wrote:
=C2=ABEvery year someone comes on comp.lang.lisp and informs us that it is
the parenthesis that are the problem.=C2=BB
Huh? What you wrote above, has nothing to do with my essay. It has to
do with Common Lisping XXXXhead's nagging toothache.
=C2=ABBut in more than forty years no one has come up with a better
alternative, and it hasn't been for want of trying or lack of
imagination. =C2=BB
What about Logo? Dylan? Arc? Mathematica? And the Scheme Lisp's coming
standard, the R6RS, introducing [] {} and other syntaxes that breaks
the nested paren. (note: this is mentioned in the article)
Also, in the article, i mentioned, that lisp syntax itself, contains
several _ad hoc_ syntax sugars for the purpose of reducing nested
parenthesis. This, for anyone not prejudiced, who put thought into
reading the article, might suggest a argument that too many nested
parens is considered a problem by the grand daddies of lisp founder
themselves. When you code lisp tonight, why don't you aways use
=E2=80=9C(quote ...)=E2=80=9D instead of =E2=80=9C'=E2=80=9D, hum?
As to why, Common Lisp, didn't change its syntax away from parens...
well... with all the Common Lisp XXXXheads in hostile denial as
exhibited in this thread, and the stale air hold by these old lispers
new fanatical recruits, how's any change, if necessary, ever gonna
begin?
A prosperous society needs open mind and open discussion. The lisper
XXXXheads, as exhibited in this thread, have been unreasonable and
persecuting to criticism. I believe, many lisp's problems,
(specifically, problems of Common Lisp today), its stagnation, is due
to these XXXXheads.
Xah
xah@xahlee.org
=E2=88=91 http://xahlee.org/
| |
| JeremiaThomas@gmail.com 2007-05-07, 7:04 pm |
| On May 7, 2:21=C2=A0pm, Xah Lee <x...@xahlee.org> wrote:
> 2007-05-06
>
>
> A prosperous society needs open mind and open discussion. The lisper
> XXXXheads, as exhibited in this thread, have been unreasonable and
> persecuting to criticism. I believe, many lisp's problems,
> (specifically, problems of Common Lisp today), its stagnation, is due
> to these XXXXheads.
>
> =C2=A0 Xah
> =C2=A0 x...@xahlee.org
> =E2=88=91http://xahlee.org/
A prosperous society needs open mind and open discussion , not an
insults and miles of empty words from people who don't know anything
about the subject. Learn some Lisp before posting more thrash for
something you don't know anything about.
JT
Lisp rules Xah Lee and Jon Harrop suck
| |
| java.oke@gmail.com 2007-05-07, 7:04 pm |
|
Xah Lee wrote:
> For example, there are Christians, and there are Islamics. Doesn't
> matter what you say, what logic, what rationality, what patience, what
> evidence, for vast majority of these people, God of their variety will
> exist, and will be the only type.
[OFF TOPIC]
Religion is a good example to compare with programming languages:
In fact, religion (in its real sense) is never in opposite to reason,
but it is far beyond it! So far, that only a God is able to enlighten
you, where your intelligence is not able to reach.
Now, with programming languages, there seems to be a kind of humans
not able to get the enlightening from something beyond their
capabilities (sorry, intelligence alone is not enough; one very
important ingredient is simplicity, in its profound sense...).
-JO
| |
| Xah Lee 2007-05-07, 7:04 pm |
| Dear Tim X,
i don't know who you are. But i vaguely recall, you are one of the
moronic respondents to one of my criticisms on how Emacs needs to be
modernized. (and i hated you very much)
(See
Modernization Emacs
http://xahlee.org/emacs/modernization.html
)
One of the criticism of my numerous criticism in the computing
industry, is that i am not =E2=80=9Cconstructive=E2=80=9D in some way. This=
is fuzzy
and silly.
For example, poeple don't respond to professional critics, by
retorting =E2=80=9CWhat have you done?=E2=80=9D
(
See
Criticism versus Constructive Criticism
UnixResource_dir/writ/criticism.html
)
A good criticism, in itself, is a contribution to the community.
Philosophers, for example, are examplary in this regard.
But as to what i have actually done for the computing communities of
which i've criticized besides criticism, i think there's a few.
Mostly, i have several tutorials on my website:
Perl and Python tutorial (~80 HTML pages)
=E2=80=A2 http://xahlee.org/perl-python/python.html
Emacs and Emacs Lisp tutorial (~80 HTML pages)
=E2=80=A2 http://xahlee.org/emacs/emacs.html
A complete, mirror of the official HTML documentation of Emacs Lisp,
with HTML code modified (corrected) so that they are W3C valid HTML
document, and CSS added for easier reading. (~850 HTML pages)
=E2=80=A2 http://xahlee.org/elisp/index.html
A Java tutorial
=E2=80=A2 http://xahlee.org/java-a-day/java.html (~40 HTML pages)
A Javascript and HTML and CSS tutorial (~70 HTML pages)
=E2=80=A2 http://xahlee.org/js/js.html
These are informal tutorials. Sure, they are not as rigorous as
published books in print. Sure, perhaps 20% of the content of my
tutorials are filled with technical criticisms.
You, as a tech g er, may argue that my writings or teachings are in
bad quality or taste in your eyes. But they are there, and unarguably
took years to create. In all fairness, i think society would judge
them, to be positive, or =E2=80=9Cconstructive=E2=80=9D contributions. (and=
i do
receive regular emails from professional programers, educators,
professors, mathematicians (including a Nobel Prize laureate, to thank
me on my articles in diverse areas)
There was a Python XXXXhead, who's name is Steve Holden ( http://www.holden=
web.com/
), in 2005-04-12, in response to criticisms i made of the
motherXXXXing garbage of the Python documentation, challenged me to
rewrite it, with the offer of $100 USD.
I responded, and the result is a full-rewrite of the Python's RE doc.
(
Pyhton Regex Documentation: String Pattern Matching
http://xahlee.org/perl-python/pytho.../module-re.html
)
He, reneged his promise to pay, citing that i missed the deadline
(that he missed my announcement), and that i failed the qualifications
of which he made the $100 offer.
Regardless of the situation, my rewrite of the entire Python
documentation of its RE module, is a contribution.
So, yeah, i made contributions, and arguably, quite a lot in the
computing industry. By my mere criticism, and by actual tutorials and
codes. (not counting, areas in Math, or Mathematica programing)
But really, the newsgroup XXXXheads, their accusation of my =E2=80=9Cnegati=
ve=E2=80=9D
criticism, or my =E2=80=9Clack of contribution=E2=80=9D, really are due to =
their lack
of general education in the area of humanities (in particular: their
lack of understanding of the role of criticism), and as a execuse to
attack me in the political struggle, and or simply careless farts to
posts they don't like in newsgroups.
Xah
xah@xahlee.org
=E2=88=91 http://xahlee.org/
Xah Lee wrote:
=C2=AB How Lisp's Nested Notation Limits The Language's Utility
http://xahlee.org/UnixResource_dir/writ/notations.html
=C2=BB
Tim Bradshaw wrote:
=C2=AB Very good. =C2=A0Now, off you go and design and implement an alterna=
tive
syntax. It's easy, it's been done hundreds of times. =C2=A0I think I have
two or three limited examples on my web site and several more I never
bothered publishing. =C2=A0There must, as I say, be hundreds of examples
around and probably thousands when you count all the non-published
ones. =C2=A0So pick the best and use them, or, since you're by far the
smartest person here, why not come up with your own? Jon Harrop can
probably help you. =C2=BB
Tim X wrote:
=C2=AB
Actually, I think this is a very good idea forXah. Many have been very
critical of what he posts (including myself), but I suspect a large
percentage of people totally dismiss what he writes because he doesn't
provide any constructive alternatives. He regularly posts about what
is wrong with emacs, lisp, unix, perl etc. but rarely do I see any
proposed solutions or constructive ideas that might actually improve
the situation.
come onXah, you have made frequent references to your superior IQ,
your ability to write and express ideas. Its easy to moan about whats
wrong with the world, time to put your money where your mouth is. Take
some of that boundless IQ and your superior skills in communication
and post some ideas on how things could be improved.
=C2=BB
| |
| Joe Marshall 2007-05-07, 7:04 pm |
| On May 7, 5:21 am, Xah Lee <x...@xahlee.org> wrote:
> 2007-05-06
>
> jrm wrote:
> =ABI think you're wrong, Xah. If the syntax is a problem, why haven't
> any alternative syntaxes taken over for s-expressions? I point to
> these examples:=BB
>
>
> My article, is not titled "The stupidity of Lisp Syntax". Nor "Lisp's
> got syntax problems". Nor, "The moronicity of Common Lisp XXXXheads".
>
> The title is "How Lisp's Nested Notation Limits The Language's
> Utility".
Point taken. I got distracted.
| |
| Pascal Costanza 2007-05-07, 7:04 pm |
| Xah Lee wrote:
> But also, lisp can actually relatively easily,
> create a layer of syntax on top of sexp...
It was hard to find out that there is actually a question somewhere deep
down in your posting.
Here is one possible answer:
(defmacro pipe (&body forms)
(let ((var (gensym)))
`(macrolet ((=> (&body forms)
`(let ((,',var (funcall #',(car forms) ,',var)))
,(if (cdr forms) (cdr forms) ',var))))
(let ((,var ,(car forms)))
,(if (cdr forms) (cdr forms) var)))))
> (defun square (x) (* x x))
SQUARE
> (pipe 5 => 1+ => square => print)
36
This is just a sketch. A full version would probably require some more
work. But there you go...
Pascal
--
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/
| |
| Dan Bensen 2007-05-07, 10:03 pm |
| Pascal Costanza wrote:
> Xah Lee wrote:
> Here is one possible answer:
Just to make this slightly shorter, most nonLispers
seem to like concise syntax, so they might prefer
5 => 1+ => square => print
which in Lisp can (and sort of has to) be written even
more concisely as
(=> 5 1+ square print)
(defmacro => (&rest forms)
(let ((expr (car forms)))
(dolist (func (cdr forms) expr)
(setf expr `(funcall #',func ,expr)))))
(defun echo-sqrt ()
(write-string "Enter number to be sqrt'd: ")
(finish-output)
(=> (read-line)
parse-integer
sqrt
write-to-string
write-line))
[color=darkred]
> Enter number to be sqrt'd: 34
> 5.8309517
--
Dan
www.prairienet.org/~dsb/
| |
| Markus E Leypold 2007-05-08, 8:04 am |
|
Joe Marshall <eval.apply@gmail.com> writes:
> On May 7, 5:21 am, Xah Lee <x...@xahlee.org> wrote:
>
> Point taken. I got distracted.
Bah! How's utility defined anyway? And if "limitation of utility" (by
syntax) is not a problem (in the syntax) for a language, I don't
know. No, no -- I think xou got that right: Xah is riding on the old(1)
crank train "Lisp has too many parenthesis" and the answer "this has
never been a problem as evidenced by the non-success of alternative
syntaxes" is exactly the right one.
Regards -- Markus
(1) 50 years. Imagine.
| |
| Tim Bradshaw 2007-05-08, 8:04 am |
| On May 8, 3:44 am, Dan Bensen <randomg...@cyberspace.net> wrote:
>
> (defmacro => (&rest forms)
> (let ((expr (car forms)))
> (dolist (func (cdr forms) expr)
> (setf expr `(funcall #',func ,expr)))))
Just to be clear, this is precisely *not* what a pipe operator should
do, and it's not what it does in scsh. This is just a notation for
function composition, and that' s not what pipes are (or it's not what
they are without significant changes to what function call means).
The reason this isn't what pipes are is this (in sh)
(while wget http://some/site/blah; do sleep 30; done) | awk '...'
for instance. This perfectly reasonable fragment may fail to
terminate, yet it does (or may) result in a stream of output which
output may be useful. And that's the thing about pipelines: they
operate on potentially infinite streams. Function call in CL is not
like that.
I think you can *make* function call like that with languages which do
lazy evaluation, but CL is not natively such a language. Neither is
scsh as far as I know, and pipes etc are different things than
function calls in it.
| |
| Pascal Costanza 2007-05-09, 4:11 am |
| Tim Bradshaw wrote:
> On May 8, 3:44 am, Dan Bensen <randomg...@cyberspace.net> wrote:
>
>
> Just to be clear, this is precisely *not* what a pipe operator should
> do, and it's not what it does in scsh. This is just a notation for
> function composition, and that' s not what pipes are (or it's not what
> they are without significant changes to what function call means).
>
> The reason this isn't what pipes are is this (in sh)
>
> (while wget http://some/site/blah; do sleep 30; done) | awk '...'
>
> for instance. This perfectly reasonable fragment may fail to
> terminate, yet it does (or may) result in a stream of output which
> output may be useful. And that's the thing about pipelines: they
> operate on potentially infinite streams. Function call in CL is not
> like that.
>
> I think you can *make* function call like that with languages which do
> lazy evaluation, but CL is not natively such a language. Neither is
> scsh as far as I know, and pipes etc are different things than
> function calls in it.
OK, but Xah's complaint was about syntax, not about semantics.
Pascal
--
My website: http://p-cos.net
Common Lisp Document Repository: | | |