| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#21
| |||
| |||
| On Mon, 25 Aug 2008 08:51:08 +0200, Pascal J. Bourguignon wrote: > bothering cll today is idiotic. Xah needs a time machine! Rest assured that his colleagues at the Brotherhood of Crackpots are already working on one :-) Tamas |
|
#22
| |||
| |||
| In article <87tzd9two3.fsf@hubble.informatimago.com>, pjb@informatimago.com (Pascal J. Bourguignon) wrote: > Frank Buss <fb@frank-buss.de> writes: > > > xahlee@gmail.com wrote: > > > >> the issue is about design consistency, is not about whether sugar > >> syntax are convenient. > >> > >> For example, this sugar syntax: > >> “'(1 2 3)” > >> for > >> “(quote (1 2 3))” > >> > >> can be designed alternatively like this: > >> “(' (1 2 3))” > >> > >> which keeps lisp's regular form (f args). > > > > But this wouldn't be very sweet syntactic sugar. > > Doesn't matter. All these complains should be sent to the authors of > LISP. That is, 50 years back in time. Setting up a web site or > bothering cll today is idiotic. Xah needs a time machine! Please not. It could cause real damage. My Symbolics Lisp Machine could be de-materialized if history gets changed. -- http://lispm.dyndns.org/ |
|
#23
| |||
| |||
| On Aug 24, 11:31 pm, Frank Buss <f...@frank-buss.de> wrote: > xah...@gmail.com wrote: > > the issue is about design consistency, is not about whether sugar > > syntax are convenient. > > > For example, this sugar syntax: > > ´'(1 2 3)¡ > > for > > ´(quote (1 2 3))¡ > > > can be designed alternatively like this: > > ´(' (1 2 3))¡ > > > which keeps lisp's regular form (f args). > > But this wouldn't be very sweet syntactic sugar. Frank, the question is not about whether that example is or is not a sweet syntactic sugar. The example is a illustration of a syntax sugar that are consistent with lisp's scheme of syntax. The example was given because you did not distinguish syntax sugars with respect to the lisp's syntactical form (f x1 x2 x3...). > Maybe you should try to > use Lisp for a larger project yourself to see if it is usable. > I think the > way how ' is defined helps to write and read Lisp code. But you can change > the Lisp reader, if you don't like it and create your own syntax. remember, the criticism is one in the context of design. It's not about “whether ispers have problems with lisp”, or whether “you have a problem with lisp”, or whether “you like lisp?”. Suppose you criticized the design of penny-farthing bikes, then some fan retort: we don't have a problem with it; if you have a problem, you can practice more; if you like equal-sized wheels, perhaps you can call a blacksmith. --------------------------------------------- Fundamental Problems of Lisp Xah Lee, 2008-07 In this article, we discuss 2 problems that are rooted in lisp. One is the irregularity in its often cited regular syntax. The other is the language's use of “cons” for list. Syntax Irregularities Lisp family of languages, in particular, Common Lisp, Scheme Lisp, Emacs Lisp, are well know for its syntax's regularity, namely, “everything” is of the form “(f x1 x2 ...)”.. However, it is little talked about that there are several irregularities in its syntax. Here are some examples of the syntax irregularity. The comment syntax of semicolon to end of line “;”. The dotted notation for cons cell “(1 . 2)”. The single quote syntax used to hold evaluation, e.g. “'(1 2 3)”. The backquote and comma syntax used to hold but evaluate parts of expression, e.g. “(setq x 1) (setq myVariableAndValuePair `(x ,x))”. The “,@” for inserting a list as elements into another list.. e.g. “(setq myListX (list 1 2)) (setq myListY (list 3 4)) (setq myListXY `(,@ myListX ,@ myListY))” In the following, we detail how these irregularities hamper the power of regular syntax, and some powerful features and language developments that lisp have missed largely due to it. Confusing Lisp's irregular syntax are practically confusing. For example, the difference between “(list 1 2 3)”, “'(1 2 3)”, “(quote (1 2 3))” is a frequently asked question. The use of “`”, “,”, “,@” etc are esoteric. If for all these special syntactical elements use the regular form “(f args)”, then much confusion will be reduced and people will understand and use these features better. For example, The “'(1 2 3)” might be changed to “(' 1 2 3)”, and (setq myListXY `(,@ myListX ,@ myListY)) could have been: (setq myListXY (eval-parts (splice myListX) (splice myListY))) or with sugar syntax for typing convenience: (setq myListXY (` (,@ myListX) (,@ myListY)))” Syntax-Semantics Correspondence A regular nested syntax has a one-to-one correspondence to the language's abstract syntax tree, and to a large extent the syntax has some correspondence to the language's semantics. The irregularities in syntax breaks this correspondence. For example, programers can pretty much tell what piece of source code “(f args)” do by just reading the function's name. As a contrast, in syntax soup languages such as Java, Perl, the programmer must be familiar with each of its tens of syntactical forms. (e.g. “if (...) {...}”, “for (...; ...; ...) {...}”, “(some? this: that)”, “x++”, “myList = [1, 2, 3]” etc.) As a example, if lisp's “'(1 2 3)” is actually “(quote 1 2 3)” or shortcut form “(' 1 2 3)”, then it is much easier to understand. Source Code Transformation Lisp relies on a regular nested syntax. Because of such regularity of the syntax, it allows transformation of the source code by a simple lexical scan. This has powerful ramification. (lisp's macros is one example) For example, since the syntax is regular, one could easily have alternative, easier to read syntaxes as a layer. (the concept is somewhat known in early lisp as M-expression) Mathematica took this advantage (probably independent of lisp's influence), so that you really have easy to read syntax, yet fully retain the regular form advantages. In lisp history, such layer been done and tried here and there in various forms or langs ( CGOL↗, Dylan↗), but nevercaught on due to largely social happenings. Part of these reasons are political and lisper's sensitivity to criticism of its nested parens. Automatic, Uniform, Universal, Source Code Formatting One of the advantage of pure fully functional syntax is that a programer should never need to format his source code (i.e. pressing tabs, returns) in coding, and save the hundreds hours of labor, guides, tutorials, advices, publications, editor tools, on what's known as “coding style convention”, because the editor can reformat the source code on the fly based on a simple lexical scan. Because lisp's syntax has lots of nested parenthesis, the source code formatting is much more a labor intensive than syntax soup languages such as Perl, even with dedicated lisp editor such as emacs that contain large number editing commands on nested syntax. The lisp community, established a particular way of formatting lisp code as exhibited in emacs's lisp modes and written guides of conventions. The recognization of such convention further erode any possibility and awareness of automatic, uniform, universal, formatting. (e.g. the uniform and universal part of advantage is exhibited by Python) As a example, the Mathematica language features a pure nested syntax similar to lisp but without irregularities. So, in that language, since version 3 released in 1996, the source code in its editor are automatically formatted on the fly as programer types, much in the same way paragraphs are automatically wrapped in a word processor since early 1990s Syntax As Markup Language One of the power of such pure nested syntax is that you could build up layers on top of it, so that the source code can function as markup of conventional mathematical notations (i.e. MathML) and or as a word- processing-like file that can contain structures, images (e.g. Microsoft Office Open XML↗), yet lose practical nothing. This is done in Mathematica in 1996 with release of Mathematica version 3. (e.g. think of XML, its uniform nested syntax, its diverse use as a markup lang, then, some people are adding computational semantics to it now (i.e. a computer language with syntax of xml. e.g. O:XML↗). You can think of Mathematica going the other way, by starting with a computer lang with a regular nested syntax, then add new but inert keywords to it with markup semantics. The compiler will just treat these inert keywords like comment syntax when doing computation. When the source code is read by a editor, the editor takes the markup keywords for structural or stylitic representation, with title, chapter heading, tables, images, animations, hyperlinks, typeset math expression (e.g. think of MathML↗) etc. The non-marked-up keywords are shown as one-dimentional textual source code just like source code is normally shown is most languages.) Xah ∑ http://xahlee.org/ ☄ |
|
#24
| |||
| |||
| xahlee@gmail.com wrote: > Frank, the question is not about whether that example is or is not a > sweet syntactic sugar. > > The example is a illustration of a syntax sugar that are consistent > with lisp's scheme of syntax. Schemer: "Buddha is small, clean, and serious." Lispnik: "Buddha is big, has hairy armpits, and laughs." XNikodemus Siivola If it is useful, why using a more consistent, but more annoying notation? -- Frank Buss, fb@frank-buss.de http://www.frank-buss.de, http://www.it4-systems.de |
|
#25
| |||
| |||
| Xah wrote: « Fundamental Problems of Lisp http://xahlee.org/UnixResource_dir/w..._problems.html » Frank Buss wrote: > Schemer: "Buddha is small, clean, and serious." Lispnik: "Buddha is big, > has hairy armpits, and laughs." —Nikodemus Siivola > > If it is useful, why using a more consistent, but more annoying notation? ultimately, you have to ask why lisper advocate nested syntax in the first place. if lispers love the nested syntax, then, the argument that there should not be irregularities, has merit. If lispers think occational irregularities of sugar syntax is good, then there's the question of how many, or what form. You might as well introduce “i++” for “(setq i (1+ i))”. PS this post is posted to comp.lang.lisp,comp.lang.functional . Xah ∑ http://xahlee.org/ ☄ |
|
#26
| |||
| |||
| > (defmacro q (&rest args) (list 'quote args)) Q > (q a b c) (A B C) Why on earth you can't just do this kind of thing yourself is beyond me. Use the code. Be happy(er). |
|
#27
| |||
| |||
| Realising you might throw an exception to the really ugly syntax of my code, I felt I should post a fix: (defmacro q (&rest args) (list (quote quote) args)) |
|
#28
| |||
| |||
| "xahlee@gmail.com" <xahlee@gmail.com> wrote on Mon, 25 Aug 2008: > ultimately, you have to ask why lisper advocate nested syntax in the > first place. One reason, is that it enables the very-powerful CL-style macros. > if lispers love the nested syntax, then, the argument that there should not > be irregularities, has merit. No, because the macros operate on the read-in structure, not on the surface sequence of characters. All that matters is that every sequence of characters which corresponds to valid lisp code, is equivalent to a known, unique, "nested syntax" data structure. Then, all your processing (like macros) can deal with the data structures directly, and can ignore the surface syntax. Despite many requests, you've shown no examples on how the "irregular" surface syntax makes anything harder for any (user) programmer. -- Don __________________________________________________ _____________________________ Don Geddis http://don.geddis.org/ don@geddis.org I hope that after I die, people will say of me: "That guy sure owed me a lot of money." -- Deep Thoughts, by Jack Handey [1999] |
|
#29
| |||
| |||
| Dear Don, didn't we just exchanged some dozen of messages without fruit this week? I called you a moron, and you prob thought i'm a moron but isn't courageous enough to say it. perhaps it's time that you go enjoy doing your karate and i go enjoy my masturbation? if u really want my answers, you have to pay me consulting fee. Since you are a great person, with gret knowledge in AI, and expert in jujitsu, you win a big discount. Pay $1 to “xah (@) xahlee.org” paypal, then we can resume the debate with a fresh understanding. btw, i wrote some rambling on martial arts 2 years ago. Here: http://xahlee.org/Periodic_dosage_dir/t1/kung-fu.html what do u think of it? Xah ∑ http://xahlee.org/ ☄ On Aug 25, 9:39 am, Don Geddis <d...@geddis.org> wrote: > "xah...@gmail.com" <xah...@gmail.com> wrote on Mon, 25 Aug 2008: > > > ultimately, you have to ask why lisper advocate nested syntax in the > > first place. > > One reason, is that it enables the very-powerful CL-style macros. > > > if lispers love the nested syntax, then, the argument that there shouldnot > > be irregularities, has merit. > > No, because the macros operate on the read-in structure, not on the > surface sequence of characters. > > All that matters is that every sequence of characters which corresponds to > valid lisp code, is equivalent to a known, unique, "nested syntax" data > structure. Then, all your processing (like macros) can deal with the > data structures directly, and can ignore the surface syntax. > > Despite many requests, you've shown no examples on how the "irregular" > surface syntax makes anything harder for any (user) programmer. |
|
#30
| |||
| |||
| "xahlee@gmail.com" <xahlee@gmail.com> wrote on Mon, 25 Aug 2008: > didn't we just exchanged some dozen of messages without fruit this week? I believe we did. Yet your failure in that thread hasn't appeared to stop you from continuing to post your misleading opinions. Hence the unfortunate need to continue to correct the impression you attempt to leave on c.l.l readers. > I called you a moron, and you prob thought i'm a moron but isn't courageous > enough to say it. I didn't realize that name-calling was a sign of courage. I'll attempt to generate the courage: ...ummmm....ummmm....ummmm.... "Moron." How'd I do? > btw, i wrote some rambling on martial arts 2 years ago. Here: > http://xahlee.org/Periodic_dosage_dir/t1/kung-fu.html I enjoy how your knowledge of martial arts appears to be derived from movies and video games. > what do u think of it? I think it fits in very well with the other writings at your site. Certainly, the quality of the insights fits in. I will have to say, I thought the tone was less insulting than usual, and the sentence structure, grammar, and spelling, were far clearer that your usual writing. But probably those remaining defects can be repaired with a little additional editing. -- Don __________________________________________________ _____________________________ Don Geddis http://don.geddis.org/ don@geddis.org The dumber people think you are, the more surprised they're going to be when you kill them. -- William Clayton |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.