On Thu, 14 Feb 2002, Erik Naggum wrote: > * Ed L Cashin <ecas...@uga.edu> >| Also, I remember thinking that lisp looked like "text vomit" >| compared to languages whose structure lexically mirrors what's >| going on.
I think the structure of Lisp does mirror what's going on.
> It appears warranted by the various reactions people have posted > and told of elsewhere to conclude that Common Lisp is a language > that is better suited for those who are more verbal than visual in > how they remember and learn. Those who are more visual, tend to > be thrown off by the lack of visual clues and the preponderance of > words they need to recognize in order to "see" the structure. The > verbal, who recognize words the way the visual see pictures and > figures, have no such problem.
I wonder on what basis you draw the conclusion that the distinction is between verbal and visual and wonder even more about the possible implications. For instance, a verbal learner should not be thrown off by code like (member (car (list (do-something here (based on another complicated computation) ... <bunch of further arguments elided>)))). This seems counterintuitive to me, I think even experienced Lisp programmers tend to have (reading) problems with such gross code. [1]
With respect to the more visual oriented, I think what helped me most was to recognize that there is structure but that parentheses are not an issue one needs to care about, as long as you do follow it. I think Graham has an example in his "Ansi CL" book in which he presents some Lisp code with and without the parens. It's getting the structure that matters, not the parens. I think, a claim somebody made is likely to be true across most programming languages, which is that it does not really matter what style you're following, it's following the style that matters [2].
But then again, I may be one of those who you would classify as a visual oriented person, although I tend to see myself as being verbal oriented. Come to think of it, I'm a very unlikely candidate for participating in an obfuscated code contest, although I am uncertain whether that tells a story or doesn't.
Holger
Footnotes: [1] Some time ago, I made some whitespace modifications to some old and very ugly looking code. I was not the only one feeling that the result was much more readable afterwards.
[2] Of course, when you have to follow some style guideline enforced by external forces, this may throw you off when its totally against your personal preferences.
-- --- http://www.coling.uni-freiburg.de/~schauer/ --- "/home/moehwald > echo "the quick brown fox jumps over the lazy dog" | tr -d aeiou" "Jetzt weiss ich endlich, wie ein gewisser A.K. seine Postings erstellt." -- Sven Geggus in de.comp.os.unix.linux.misc
> > I think that by definition, INTERCAL (whose design goal was to remove > > any feature known to any other programming language) fits the bill.
> > Cheers
> Intercal is a joke. I'm very stupid; but I'm just smart enough to > know that!
Given your username.... :)
42
-- Marco Antoniotti ======================================================== NYU Courant Bioinformatics Group tel. +1 - 212 - 998 3488 719 Broadway 12th Floor fax +1 - 212 - 995 4122 New York, NY 10003, USA http://bioinformatics.cat.nyu.edu "Hello New York! We'll do what we can!" Bill Murray in `Ghostbusters'.
> Yes, I think this is what Lisp is about. Languages like Perl or > Ruby (or C) have decided that one sort of thing is interesting, and > have a syntax which has been greatly optimized for that single > thing. Perl is *really good* at string-bashing code with regexps, C > is really good at very terse OS code that both runs and can be > compiled in reasonable time on a PDP11-class machine, and so on.
> Lisp has decided not to decide. Rather than provide a great mass of > syntactic tricks to support some particular style or programming > technique, Lisp provides a minimalist syntax which is just adequate > to express nested structures of various kinds without making any > commitment as to their meaning. The programmer then decides what > this syntax means in any instance.
Yes, and I think that's why it often requires a little bit of experience with several programming that are good in a more limited domain before lisp's generality can be recognized as a boon.
> ... > > I would like to experiment with > > working with this syntax for a while just to see how I think it works, > > however. It might actually be the easiest way to get around the > > parenthesis "perception problem".
> I don't know. Holger Schauer has a point: emacs makes it easy to edit > lisp, but many people don't use emacs. If I didn't already feel > confident that emacs will keep track of the parens and the indentation > for me on first encountering lisp, the nesting might appear > overwhelming.
> Also, I remember thinking that lisp looked like "text vomit" compared > to languages whose structure lexically mirrors what's going on. > Here's an example in ruby:
The point being that in CL you can modify the language, and make it look like CL or something else.
Here is one of my favourite `primes' in conforming CL.
(in-package "SETL-USER")
(defun primes (max) [n in (range 3 max 2) / (not (exist m in (range 3 (min (1- n) (+ 2 (sqrt n))) 2) / (= (mod n m) 0)))])
> I know that an experienced lisper could create a read macro to support > a syntax like in the first example, but someone encountering lisp for > the first time might not know that.
So? Does that warrant the application of Greenspun's Tenth? :)
> My first time seeing a large amount of lisp code was in the emacs > sources.
A lot of ELisp code is not all that nice looking. Especially because a lot of ELisp code does not (require 'cl) :)
Cheers
-- Marco Antoniotti ======================================================== NYU Courant Bioinformatics Group tel. +1 - 212 - 998 3488 719 Broadway 12th Floor fax +1 - 212 - 995 4122 New York, NY 10003, USA http://bioinformatics.cat.nyu.edu "Hello New York! We'll do what we can!" Bill Murray in `Ghostbusters'.
Marco Antoniotti <marc...@cs.nyu.edu> writes: > Here is one of my favourite `primes' in conforming CL.
> (in-package "SETL-USER")
> (defun primes (max) > [n in (range 3 max 2) > / (not (exist m in (range 3 (min (1- n) (+ 2 (sqrt n))) 2) > / (= (mod n m) 0)))])
I appreciate the point, but I thought that we decided that "conforming CL" programmes needed to include their macros and reader-macros to be properly conforming... :-)
* Holger Schauer <Holger.Scha...@gmx.de> | I wonder on what basis you draw the conclusion that the distinction is | between verbal and visual and wonder even more about the possible | implications.
Sigh. I wrote:
It appears warranted by the various reactions people have posted and told of elsewhere to conclude that Common Lisp is a language that is better suited for those who are more verbal than visual in how they remember and learn.
| For instance, a verbal learner should not be thrown off by code like | (member (car (list (do-something here (based on another complicated | computation) ... <bunch of further arguments elided>)))). This seems | counterintuitive to me, I think even experienced Lisp programmers tend to | have (reading) problems with such gross code. [1]
On what basis do you conclude something about what a "verbal learner" should or should not be thrown off by?
| But then again, I may be one of those who you would classify as a | visual oriented person
Why do you think this is an either-or issue? When I write "more verbal than visual" and try to be very clear that we are talking about a point on a line between two extrama, please do not waste my time by assuming that only the extrema are worth talking about. Nobody is "classified" as a visual-oriented person, it is a matter of what you are more comfortable with, not some one-bit flag in your personality.
/// -- In a fight against something, the fight has value, victory has none. In a fight for something, the fight is a loss, victory merely relief.
> I wonder on what basis you draw the conclusion that the distinction is > between verbal and visual and wonder even more about the possible > implications. For instance, a verbal learner should not be thrown off > by code like (member (car (list (do-something here (based on another > complicated computation) ... <bunch of further arguments elided>)))). > This seems counterintuitive to me, I think even experienced Lisp > programmers tend to have (reading) problems with such gross code. [1]
> With respect to the more visual oriented, I think what helped me most > was to recognize that there is structure but that parentheses are not > an issue one needs to care about, as long as you do follow it. I think > Graham has an example in his "Ansi CL" book in which he presents some > Lisp code with and without the parens. It's getting the structure that > matters, not the parens. I think, a claim somebody made is likely to > be true across most programming languages, which is that it does not > really matter what style you're following, it's following the style > that matters [2].
I don't believe Erik intended to suggest that verbal people can easliy read poorly formatted code. Rather, lisp code is more about words than about granting special meaning to every non-text character on your keyboard. As a simple example, consider array access in Lisp and C/C++/Java:
(aref *some-array* 10) vs. some_array[10];
In C, the braces take the place of "aref" and are easily spotted, even by someone who has trouble spotting "aref" in a mass of text. Thus, discounting syntactic characters (parens, semi-colons, and braces), C code has a lot more non-character symbols than Lisp. The structure is still important in both cases.
I show the extreme example of a visually-oriented language, but I've so far managed to avoid learning any Perl.
>> The lisp example did the same thing as the ruby example -- creating a >> hash table and printing its contents. But my point was the visual >> impact of the syntax and had nothing to do with the use of the example >> code.
>Yes, I think this is what Lisp is about. Languages like Perl or Ruby >(or C) have decided that one sort of thing is interesting, and have a >syntax which has been greatly optimized for that single thing. Perl >is *really good* at string-bashing code with regexps, C is really good >at very terse OS code that both runs and can be compiled in reasonable >time on a PDP11-class machine, and so on.
>Lisp has decided not to decide. Rather than provide a great mass of >syntactic tricks to support some particular style or programming >technique, Lisp provides a minimalist syntax which is just adequate to >express nested structures of various kinds without making any >commitment as to their meaning. The programmer then decides what this >syntax means in any instance.
>Lisp is a toolkit for language design not a toolkit for solving >problems in particular domain. Of course, people will typically >evolve special languages in Lisp if they need to spend enough time in >any one domain to make it worth while, but since those languages are >usually application specific and not well-known, it's always easy to >demonstrate that any given language has a better syntax for any given >application than Lisp does.
I am inclined to agree, but just yesterday a coupla posts here were praising special tools over general tools. That also sounded somewhat agreeable with at the time, except that their argument put CL firmly on the side of the specializers, not generalizers as the above seems to be doing (unless Lisp is not being equated with CL).
On Thu, 14 Feb 2002, Erik Naggum wrote: > * Holger Schauer <Holger.Scha...@gmx.de> >| I wonder on what basis you draw the conclusion that the distinction >| is between verbal and visual and wonder even more about the >| possible implications.
> Sigh. I wrote:
> It appears warranted by the various reactions people have posted > and told of elsewhere to conclude that Common Lisp is a language > that is better suited for those who are more verbal than visual > in how they remember and learn.
Yes, I actually read what you wrote but was not sure what exactly the various reactions have led you to this conclusion, as I have difficulties -- given what I've read in this thread -- to arrive at the same.
>| For instance, a verbal learner should not be thrown off by code >| like (member (car (list (do-something here (based on another >| complicated computation) ... <bunch of further arguments >| elided>)))). This seems counterintuitive to me, I think even >| experienced Lisp programmers tend to have (reading) problems with >| such gross code. [1]
> On what basis do you conclude something about what a "verbal > learner" should or should not be thrown off by?
Good question. I was in fact just reacting to the second half of your paragraph, substituting "visual learner" for your "those who are more visual":
>> Those who are more visual, tend to be thrown off by the lack of >> visual clues and the preponderance of words they need to >> recognize in order to "see" the structure. The verbal, who >> recognize words the way the visual see pictures and figures, >> have no such problem.
As I said, I was wondering whether my "conclusion" would be a valid implication of the distinction you put forward. It doesn't seem to be, though. The question then is whether I'm bashing a strawmen or not (I don't intend to).
>| But then again, I may be one of those who you would classify as a >| visual oriented person
> Why do you think this is an either-or issue? When I write "more > verbal than visual" and try to be very clear that we are talking > about a point on a line between two extrama, please do not waste > my time by assuming that only the extrema are worth talking about. > Nobody is "classified" as a visual-oriented person, it is a matter > of what you are more comfortable with, not some one-bit flag in > your personality.
Yes, this is certainly true. However, I was wondering whether I'm as verbal as I think I am and whether that leads me to some fast (and wrong) conclusions.
Holger
-- --- http://www.coling.uni-freiburg.de/~schauer/ --- "/home/moehwald > echo "the quick brown fox jumps over the lazy dog" | tr -d aeiou" "Jetzt weiss ich endlich, wie ein gewisser A.K. seine Postings erstellt." -- Sven Geggus in de.comp.os.unix.linux.misc
> I don't believe Erik intended to suggest that verbal people can > easliy read poorly formatted code. Rather, lisp code is more about > words than about granting special meaning to every non-text > character on your keyboard.
Well, yes, I agree with that largely. I would not go as far as saying that words don't matter in other languages (but then nobody said that, either). They do matter, of course, as much as in CL, minus you've got to get those non-text characters right first :-) Syntax can be pretty annoying, but after all, it's just syntax, not semantics.
More to the point though, even if, in CL, words matter "more" than other things, formatting still is an important matter. But formatting, or structure, is clearly an issue of visually grasping what's going on. That's an important support to (verbally) understanding code.
I hasten to add (that I believe) that throwing a bunch of non-text characters all over the place to further enhance such support is misguided.
> The structure is still important in both cases.
Exactly my point.
Holger
-- --- http://www.coling.uni-freiburg.de/~schauer/ --- "/home/moehwald > echo "the quick brown fox jumps over the lazy dog" | tr -d aeiou" "Jetzt weiss ich endlich, wie ein gewisser A.K. seine Postings erstellt." -- Sven Geggus in de.comp.os.unix.linux.misc
* Dorai Sitaram wrote: > I am inclined to agree, but just yesterday a coupla > posts here were praising special tools over > general tools. That also sounded somewhat agreeable > with at the time, except that their argument put CL > firmly on the side of the specializers, not > generalizers as the above seems to be doing (unless > Lisp is not being equated with CL).
If you are referring to the article I wrote where I said I didn't try and write general libraries or tools, then that's not quite what I was trying to say.
What I meant was that doing `library standard' or `language standard' systems is, in my opinion, very hard indeed (and many of the so-called `standard libraries' such as, for instance, the Win32 API are in my opinion good examples of systems which are *failing* to be good enough and thus require endless reinvention).
I'm all in favour of general tools (which should be library/language standard), and I think that CL is a very good example of such a general tool whose design is actually adequate in almost all areas (that is meant to be very high praise: there aren't any bits of CL which I find unusably badly designed, which is not something I've come across very often).
*But*, since I think that design of general tools is so hard, or at least it is hard for me, I tend to not try, but instead to design special tools for the job at hand. That way I actually get the job done.
So I wasn't making a value judgement, more trying to describe how I work.
Christophe Rhodes <cs...@cam.ac.uk> writes: > Marco Antoniotti <marc...@cs.nyu.edu> writes:
> > Here is one of my favourite `primes' in conforming CL.
> > (in-package "SETL-USER")
> > (defun primes (max) > > [n in (range 3 max 2) > > / (not (exist m in (range 3 (min (1- n) (+ 2 (sqrt n))) 2) > > / (= (mod n m) 0)))])
> I appreciate the point, but I thought that we decided that "conforming > CL" programmes needed to include their macros and reader-macros to be > properly conforming... :-)
Come on! Throw me a bone here! :) The IN-PACKAGE is quite a give away :)
Cheers
-- Marco Antoniotti ======================================================== NYU Courant Bioinformatics Group tel. +1 - 212 - 998 3488 719 Broadway 12th Floor fax +1 - 212 - 995 4122 New York, NY 10003, USA http://bioinformatics.cat.nyu.edu "Hello New York! We'll do what we can!" Bill Murray in `Ghostbusters'.
>> I am inclined to agree, but just yesterday a coupla >> posts here were praising special tools over >> general tools. That also sounded somewhat agreeable >> with at the time, except that their argument put CL >> firmly on the side of the specializers, not >> generalizers as the above seems to be doing (unless >> Lisp is not being equated with CL).
>If you are referring to the article I wrote where I said I didn't try >and write general libraries or tools, then that's not quite what I was >trying to say. >... >*But*, since I think that design of general tools is so hard, or at >least it is hard for me, I tend to not try, but instead to design >special tools for the job at hand. That way I actually get the job >done.
>So I wasn't making a value judgement, more trying to describe how I >work.
Actually, I was referring to Thomas [Burdick] and Kent's articles rather than yours. If it was yours and I was referring to it in a followup to you yourself, let me assure you that I would find it weird to third-person it so. :-)
Marco Antoniotti <marc...@cs.nyu.edu> writes: > Ed L Cashin <ecas...@uga.edu> writes:
> > Also, I remember thinking that lisp looked like "text vomit" compared > > to languages whose structure lexically mirrors what's going on. > > Here's an example in ruby:
The point being that hash-tables (_unlike_ many other data-structures in CL), lack both reader-syntax and simple creation functions. Thus the disadvantage when compared to Ruby/Perl/...; but I consider that accidental, since CL does have such support for things like lists, vectors, arrays, etc.
Probably make-hash-table should take an initial-contents keyword arg, just like make-array does, e.g.
-- Pierre R. Mai <p...@acm.org> http://www.pmsf.de/pmai/ The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. -- Nathaniel Borenstein
> Not with me. I have no problem with parentheses, except that I don't > know all the rules to their use, and I don't want to learn the entire > common-lisp language to find out; either. I may do so, but I WILL > find a better way, if I can!
The rules are very simple. Everything in lisp is either an atom or a list. Atoms are single values; numbers, variables, strings, or a couple of assorted other things that you won't need to use that much. If you want something more complex than one of those (like, applying a function to some arguments), you need a list. Lists are delimited by parentheses, and their first element is the function you are calling or the special form you are using (I'll get to the difference between functions and special forms later). So if you want to add 4 and 5, you use the + function (yes, in lisp + is a function like any other, it's not some special operator), you write:
(+ 4 5) => 9
It's as simple as that! Here are some more examples. Say I want to add 4 to the result of multiplying 5 by 2. Starting from the outside, I write:
(+ 4 ...)
This applies the function plus the the argument 4 and the result of the multiplication (represented here as ...). Now how do you do the multiplication? Exactly the same way you did the addition:
(+ 4 (* 5 2)) => 14
All function application works exactly this way. The interpreter or compiler executes code by evaluating it. Evaluation for an number or string returns that number or string:
4 => 4
"foo" => "foo"
Evaluation of a symbol which refers to a variable returns the value of that variable:
;; x has been set or bound before to 5 x => 5
Evaluation of a list (which is a function application) evaluates every element of the list (I'm simplifying a little bit here, and using the semantics of Scheme, rather than Common Lisp, because it makes more sense that way), and then applies the function which appears at the beginning to the (evaluated) rest of the arguments (I will use < and > to enclose the evalueated value of the elements of the list):
The difference between a function and a special form is that in a special form, it doesn't go through and evaluate every element. Instead, it looks at the first one, and based on that decides how to evaluate the rest. For example, when you are using if, you don't want it to evaluate both the true and false conditions. For example, if you're writing something that controls a nuclear weapon launch (this example stolen from SICP), you don't want the statement
(if (at-war? us) (launch missile) (keep-waiting))
to launch the missile every time the if is evaluated!
So you see, parentheses in lisp are actually much simpler than those in other languages. In C, you need to learn about precedence rules, square brackets, curly braces, and all kinds of other delimeters, and parentheses are used for three different things (typecasting, function calls, and grouping arithmetic statements), while in lisp they are only used for function calls and special forms.
If you don't want to learn all of Common Lisp, I would recommend Scheme, which is much conceptually simpler than Common Lisp, but works in the same basic way. There are some good intros online; go to <http://www.schemers.org/>. Especially good is Abelson and Sussman, and Sussman's "Structure and Interpretation of Computer Programs" at http://mitpress.mit.edu/sicp/full-text/book/book.html (the link is kind of buried if you try to find it on schemers.org).
(apologies for presenting scheme and advocating scheme on comp.lang.lisp, but I think that it's better to introduce someone who doesn't understand all those parentheses to scheme, rather than common lisp, where you don't evaluate every element of the list uniformly)
-- Brian Campbell Real email: lambda (at) cs (dot) dartmouth (dot) edu
Brian Campbell <lambda2...@yahoo.com> writes: > The rules are very simple. Everything in lisp is either an atom or a > list. Atoms are single values; numbers, variables, strings, or a couple > of assorted other things that you won't need to use that much. If you
The first sentence is true.
As by definition an atom is anything that is not a cons, then insofar as the second sentence is true, it's trivially true.
This gives us problems with the third sentence, as atoms thus include things like packages, arrays, hash tables, and CLOS instances, which I hope you will agree are generally _not_ "things that you won't need to use that much"...
If in the second sentence you had instead said "Everything in lisp _code_ is either an atom or a list", you could have made a rather more defensible (if still not entirely justified) claim on the third sentence, because code doesn't often contain literal hash tables.
OK, maybe I'm nit-picking, but confusing lisp code syntax with sexpr syntax, and confusing the outward sexpr-based representation with the actual objects are both common new-user mistakes, and I think it helps to be exact with terminology when explaining.
I think hash-tables are meant to store larger amounts of unordered data and I cannot see using the :initial-contents to populate a 1000+ key/value pairs (or for that matter 100,000 values). I would rebel at doing the typing. For me, storing 2 key/value or even 100 values in a hash table is just not worth it.
> > The rules are very simple. Everything in lisp is either an atom or a > > list. Atoms are single values; numbers, variables, strings, or a couple > > of assorted other things that you won't need to use that much. If you
> The first sentence is true.
> As by definition an atom is anything that is not a cons, then insofar > as the second sentence is true, it's trivially true.
I need to define my terms. As the person I was explaing to doesn't understand what all of the parentheses are for, I needed to make sure he understood what atoms and lists were.
> This gives us problems with the third sentence, as atoms thus include > things like packages, arrays, hash tables, and CLOS instances, which I > hope you will agree are generally _not_ "things that you won't need to > use that much"...
Do you see them literally in the code? It was the syntax, and how that translated to the semantics, that I was explaining, not the actual set of values that lisp can represent as data. Perhaps I should have been more specific; rather than "everything in lisp", I should have said "every expression in lisp". Besides numbers, symbols (which I called variables here to draw the parallel with other programming languages), strings, and lists, there's not much else that you see in the code. There are vectors, and quoted symbols and lists, and a few other kinds of atoms that can appear in the syntax, but as you said, you don't often see literal hash tables. Also, since I was recommending he look into Scheme if he didn't want to learn all of Common Lisp, I didn't want to confuse him with things that were different between them; should I have mentioned t and nil, or #t and #f? Should I have mentioned arrays, or just vectors? As the atoms that I mentioned are common between both scheme and common lisp, and make up 90% or more of the syntax that you see, I decided to only include them.
> If in the second sentence you had instead said "Everything in lisp > _code_ is either an atom or a list", you could have made a rather more > defensible (if still not entirely justified) claim on the third > sentence, because code doesn't often contain literal hash tables.
> OK, maybe I'm nit-picking, but confusing lisp code syntax with sexpr > syntax, and confusing the outward sexpr-based representation with the > actual objects are both common new-user mistakes, and I think it helps > to be exact with terminology when explaining.
Yes, I was sloppy. I think that coming from the perspective of the person I was writing for, it would still clear matters up more than it would confuse him. Anyhow, both lisp syntax and sexpr syntax are the syntax that can be parsed by the read function. There are additional constraints on the lisp code, it is true, but lisp code is a use of sexpressions for representing a program, and confusing the syntax with the actual objects is a mistake, but that is why, when demonstrating evaluation, I made sure to use a notation that distinguished objects from their representation.
> -dan
-- Brian Campbell Real email: lambda (at) cs (dot) dartmouth (dot) edu
> I think hash-tables are meant to store larger amounts of unordered data and > I cannot see using the :initial-contents to populate a 1000+ key/value pairs > (or for that matter 100,000 values). I would rebel at doing the typing. > For me, storing 2 key/value or even 100 values in a hash table is just not > worth it.
The value for the initial-contents argument can be arrived at in any way wanted. It is not limited to being a literal. Furthermore, in is quite conceivable that the hash-table in question is going to grow to many values (thereby validating the use of a hash-table), yet is seeded with a smallish amount of initial-contents, where the typing isn't problematic. And then there are many cases where you want to interactively test a function that is specified to work on hash-tables, where a few entries in the table suffices.
It is for those reasons that I think an initial-contents argument to make-hash-table makes as much sense as it does for make-array. Of course this is not something I'm going to fret about, but I've more than once written a "make-hash-table-from-kv-pairs"-type function, and wouldn't consider such an addition without some good will.
Of course your implicit point that alists are often a better choice (which accidentally also have good support for literal input) for smallish lookup tables is duly taken.
Regs, Pierre.
-- Pierre R. Mai <p...@acm.org> http://www.pmsf.de/pmai/ The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. -- Nathaniel Borenstein
> > It appears warranted by the various reactions people have posted and told > > of elsewhere to conclude that Common Lisp is a language that is better > > suited for those who are more verbal than visual in how they remember and > > learn. Those who are more visual, tend to be thrown off by the lack of > > visual clues and the preponderance of words they need to recognize in > > order to "see" the structure. The verbal, who recognize words the way > > the visual see pictures and figures, have no such problem.
> I think this is an interesting point. However I'm not sure it's right > or at least not uniquely right. I think I'm a terribly visual person > (although I also can read).
[etc]
Whereas I'm a visually terrible person :-), so according to Erik's criterion it makes sense that I like Lisp; but I also find visual tricks like syntax-colouring extremely helpful, in Lisp and also in other languages. (Maybe I find those tricks helpful *because* I'm not very visual; perhaps if my visual subsystem worked better it would do those jobs unaided.)
And, despite being very "verbal", I do find that sometimes the "verbosity" of Lisp bothers me. I don't think I've yet found an instance where it's (1) genuine verbosity and (2) not easily fixed with a bit of macrology or read-table manipulation; but it can still cause discomfort. It's possible that the discomfort is a useful signal that macrology might be in order.
*
Example: Earlier in the thread, someone posted a comparison between two code snippets, one in Ruby and one in Lisp. Both had the form: build a hash table containing known keys and values, then iterate over it. The Ruby code was shorter and allegedly clearer. (I find the ambiguous use of curly brackets in Ruby disagreeable, but never mind that.) And it's true: the CL code is verbose and hard to read.
But, if you're doing a lot of that sort of thing then it's the work of a minute (well, OK, five minutes) to write two simple macros so you can write
for key,value in {"foo": "bar", "baz": "quux"}.items(): print key, "->", value, "\n"
except that FORMAT looks too much like line noise to some readers. (Compression implies near-randomness.) Again, if you do a lot of writing sequences of things to *STANDARD-OUTPUT* then it's the work of another minute or two to write a function so you can say
Ruby and Python and all sorts of other languages have advantages over CL, but brevity and clarity aren't among them unless either your programs are so short that brevity and clarity don't matter anyway, or you're deliberately choosing to write CL in a way that doesn't provide the sort of brevity and clarity you want.
Erik Naggum <e...@naggum.net> wrote in message <news:3222681324844275@naggum.net>... > * Sla...@ureach.com (zaphod) > | Not with me. I have no problem with parentheses, except that I don't > | know all the rules to their use, and I don't want to learn the entire > | common-lisp language to find out; either. I may do so, but I WILL > | find a better way, if I can!
> Quite amazing. It is obviously superfluous to answer any of your > questions with technical answers. This is good to know.
Yapp; reckon I'm an illiterat know knothing cluck; or maby you don't know enough about me and my situation to know much at all about me or my situation (look Ma; recursion). Sorry about my inadequacies. If I put my attention purely on learning Common Lisp, I might surprise someone with my astuteness as a student, then again; I might not. I just wanted to let you know, that it's not neccasarilly an IRRATIONAL dislike of parens. There just might be some rationality behind it. In my case; I gave it a try, and discovered it wasn't as easy as I've been lead to beleive, but I'm so dang low-brow, I hack trial and error, when it seems right. I should have prefaced all with. Me=newbie know-nothing, tho.
* "Wade Humeniuk" <humen...@cadvision.com> | I think hash-tables are meant to store larger amounts of unordered data and | I cannot see using the :initial-contents to populate a 1000+ key/value pairs | (or for that matter 100,000 values). I would rebel at doing the typing. | For me, storing 2 key/value or even 100 values in a hash table is just not | worth it.
When a hash-table is all you have, you tend to optimize it heavily. The same goes for regexps. Both hash-tables and regular expressions are very powerful and general tools, but they turn into monstrosities when all the more specialized tools are effectively removed from the language they use.
Common Lisp has the disadvantage compared to the one-trick languages that the different access functions for various kinds of mappings between key and value are precisely that -- different. When there is only one way to do it, being offered several ways is just confusing, and so people who think "hash-table" when they should have thought "key-value mapping" will miss simple and elegant things like property lists or association lists.
I mean, if { "foo" => "bar", "baz" => "zot" } is so great, why is not (("foo" . "bar") ("baz" . "zot"))? Is it _only_ the sugar-coated syntax that is so visually appealing to some? If so, a Common Lisp programmer will write a small parser function that is called via the reader-macro support to read this list. Why is this not more used? I belive it is because most people who pine for other syntaxes have no clue how to go about specifying them or writing parsers for them, and because once you have grown that clue, you do not need it or, more importantly, want it.
I chose this design because I figured that it would be annoying to change the data if the access functions would need to change and that it would be more convenient to specify this via a readtable-local setting than add a lot more syntax for it. If you have support for the in-syntaax form and named readtables, creating a named readtable to invoke this syntax would obviously be the best solution.
Now, if you want other kinds of things to go on within { }, it is not a lot of trouble to build a parser by hand, provided you are not a moron and create syntaxes the like of C++ or some other horrible monstrosity.
Creating a writer for alists, plists, and hashtables that write data in this syntax is left as an exercise for the reader.