> This wouldn't be backwards-compatible, but it would only break for > ugly code like defstruct. Which is probably too high of a price to > pay, but that's too bad because that looks like very nice case > semantics.
What happens in your case-insensitive but case-preserving reader if you read a symbol several times, the first time from "Foo", then from "FOO", then from "foo"? Will the printed representation of the symbol possibly change every time you read it in? Would you find that acceptable?
Regards, -- Nils Goesche "Don't ask for whom the <CTRL-G> tolls."
> Before making changes, one wants to believe they are going to overcome > these costs.
Shure. Unfortunally this leads to projects where people need to develop tools for compatibility or need to spend a lot of time in porting code to another implementation. So maybe this is the only advantage of only-one-implementation-available languages like perl, phyton, VC and so on ;-)
> > This wouldn't be backwards-compatible, but it would only break for > > ugly code like defstruct. Which is probably too high of a price to > > pay, but that's too bad because that looks like very nice case > > semantics.
> What happens in your case-insensitive but case-preserving reader if > you read a symbol several times, the first time from "Foo", then from > "FOO", then from "foo"? Will the printed representation of the symbol > possibly change every time you read it in?
No. It's just a function of mapping printed text to program structure, not mutating living symbols as forms are read. EG:
* 'foo foo * 'Foo foo * 'FOO foo * '|FOO| |FOO|
> Would you find that acceptable?
Yuck, of course not.
-- /|_ .-----------------------. ,' .\ / | No to Imperialist war | ,--' _,' | Wage class war! | / / `-----------------------' ( -. | | ) | (`-. '--.) `. )----'
> > What happens in your case-insensitive but case-preserving reader if > > you read a symbol several times, the first time from "Foo", then from > > "FOO", then from "foo"? Will the printed representation of the symbol > > possibly change every time you read it in?
> No. It's just a function of mapping printed text to program > structure, not mutating living symbols as forms are read. EG:
So, the printed representation is determined at the time a symbol is interned? If yes, suppose I have two files containing our symbol. Once it is written `foo', once `Foo'. Will the printed representation now depend on the order the files are loaded?
> > Would you find that acceptable?
> Yuck, of course not.
Glad to hear that :-)
Regards, -- Nils Goesche Ask not for whom the <CONTROL-G> tolls.
cr88192 <cr88...@hotmail.nospam.com> writes: > ... though the syntax pointed out in my spec has a few bad points for > many things I would still rather use it. > at present my plans also include keeping an s-expr parser around so people > could code in that if they wanted, and display will still continue to > output s-exprs (likely anyways, I have not gotten as far as defining > structured/console input/output yet though, or much of any io...).
This was, in fact, one of the original plans of the first Lisp implementors. There was to be two languages, with S-Expressions and M-Expressions, with a parser to convert M-Expressions into S-Expressions. It turned out that the original progammers ended up not really wanting to use the M-language, so the parser was never really finished. (There were later parsers developed that did use something like the original M-Expr alternate syntax).
The lesson is that as you come to appreciate the language, you will fairly quickly come to decide that such alternate syntax is not really all that helpful to you. If you want a head start on this transformation, you should begine looking into writing some more complicated macros, an evaluator, or a symbolic expression differentiator. At that point, you need to understand and manipulate the S-expression form. Once you do that, there isn't really any benefit to adding another layer on top of it.
(I believe the S stood for Symbol -- or was it Structural? and the M for Meta)
-- Thomas A. Russ, USC/Information Sciences Institute t...@isi.edu
d...@goldshoe.gte.com (Dorai Sitaram) wrote in message <news:akiia4$7ep$1@news.gte.com>... > In article <87y9ar6679....@piracy.red-bean.com>, > Craig Brozefsky <cr...@red-bean.com> wrote: > >zi...@netvision.net.il (Ziv Caspi) writes:
> >> On Tue, 27 Aug 2002 07:02:32 +0000 (UTC), Kaz Kylheku > >> <k...@ashi.footprints.net> wrote: > >> [...] > >> >Cruft like semicolons and commas is largely replaced by whitespace.
> >> Yes, that's the point. Commas, semicolons, parens, braces in C provide > >> a larger diversity than parens and whitespace alone. This makes it > >> more difficult to parse, much more difficult (if not impossible) to do > >> the type of things people use LISP macros for, etc. But it also makes > >> it easier on the human eye to read.
> >What is the source for your assertion that it is easier for the human > >eye to read more diverse syntax?
> I think he means that more syntax offers concise > visual hints not possible when you are forced to > spelling things out with less syntax. Eg,
> "Lisp syntax is *truly* hard," don't you think?
> is certainly easier to read than
> quote capitalize lisp syntax is emphasize truly > unemphasize hard comma unquote don apostrophe t you > think query
> I think the Lisp syntax is plenty readable myself, but > I also don't think its syntax is really as terribly > minimal as it could be. It uses parens very > effectively to identify groups and subgroups, and it > uses keywords at the "car" position where other > languages wantonly use up dedicated characters -- > making for less diversity in user-chosen symbols!
But of course we have that diversity; some commonly used arithmetic functions have names based on non-alphabetic symbols: + - / * = and others. Then there are all those standard reader macros dispatched using #, and of course ` ' , ,@ . That visual diversity exists in areas where it is needed, where it benefits Lisp programmers.
Lastly, unlike in C, various glyphs other than just alphanumeric characters are constituents of symbol names, so users can make up visually distinct operator and function names.
(defun ** () ...)
Can't do that in C; any name you make up must begin with a letter or underscore, optionally followed only by letters, digits and underscores.
Kaz Kylheku <k...@ashi.footprints.net> wrote: >d...@goldshoe.gte.com (Dorai Sitaram) wrote in message <news:akiia4$7ep$1@news.gte.com>... >> In article <87y9ar6679....@piracy.red-bean.com>, >> Craig Brozefsky <cr...@red-bean.com> wrote:
>> >What is the source for your assertion that it is easier for the human >> >eye to read more diverse syntax?
>> I think he means that more syntax offers concise >> visual hints not possible when you are forced to >> spelling things out with less syntax. Eg,
>> "Lisp syntax is *truly* hard," don't you think?
>> is certainly easier to read than
>> quote capitalize lisp syntax is emphasize truly >> unemphasize hard comma unquote don apostrophe t you >> think query
>> I think the Lisp syntax is plenty readable myself, but >> I also don't think its syntax is really as terribly >> minimal as it could be. It uses parens very >> effectively to identify groups and subgroups, and it >> uses keywords at the "car" position where other >> languages wantonly use up dedicated characters -- >> making for less diversity in user-chosen symbols!
>But of course we have that diversity; some commonly used >arithmetic functions have names based on non-alphabetic >symbols: + - / * = and others. Then there are all those >standard reader macros dispatched using #, and of >course ` ' , ,@ . That visual diversity exists in >areas where it is needed, where it benefits Lisp >programmers.
I can see that my sentence was poorly constructed. I meant that the non-Lisp languages that wantonly use up dedicated characters were the ones that have less diversity in user-chosen symbols.
>Lastly, unlike in C, various glyphs other than just >alphanumeric characters are constituents of symbol >names, so users can make up visually distinct >operator and function names.
> (defun ** () ...)
>Can't do that in C; any name you make up must begin >with a letter or underscore, optionally followed >only by letters, digits and underscores.
That is indeed what I meant. I think this is one of those cases of "violent agreement".
> According to Kaz Kylheku <k...@ashi.footprints.net>: >>If you know what real macros are, why do you make stupid claims >>about Lisp having a fixed syntax which forces you do to things one >>way, such as to keep nesting deeper and deeper if you want to >>introduce a series of lexical variables which refer to earlier >>lexical variables, and have code interspersed in between?
>I'm a Lisp newbie, and I am producing code that looks like this.
>What are the better alternatives? Enquiring minds want to know! ;-)
Why not post some code you're not happy with and ask for suggestions?
Thomas A. Russ wrote: > cr88192 <cr88...@hotmail.nospam.com> writes:
>> ... though the syntax pointed out in my spec has a few bad points for >> many things I would still rather use it. >> at present my plans also include keeping an s-expr parser around so >> people could code in that if they wanted, and display will still continue >> to output s-exprs (likely anyways, I have not gotten as far as defining >> structured/console input/output yet though, or much of any io...).
> This was, in fact, one of the original plans of the first Lisp > implementors. There was to be two languages, with S-Expressions and > M-Expressions, with a parser to convert M-Expressions into > S-Expressions. It turned out that the original progammers ended up not > really wanting to use the M-language, so the parser was never really > finished. (There were later parsers developed that did use something > like the original M-Expr alternate syntax).
> The lesson is that as you come to appreciate the language, you will > fairly quickly come to decide that such alternate syntax is not really > all that helpful to you. If you want a head start on this > transformation, you should begine looking into writing some more > complicated macros, an evaluator, or a symbolic expression > differentiator. At that point, you need to understand and manipulate > the S-expression form. Once you do that, there isn't really any benefit > to adding another layer on top of it.
except for cosmetics...
I see the point though...
> (I believe the S stood for Symbol -- or was it Structural? and the M for > Meta)
* Nils Goesche | So, the printed representation is determined at the time a symbol is | interned?
The time of first read seems like a better option. That is, only the reader should remember the case to be preserved. This might involved some more housekeeping information.
| If yes, suppose I have two files containing our symbol. Once it is written | `foo', once `Foo'. Will the printed representation now depend on the order | the files are loaded?
It might, but again, I think the first time you write a symbol's name, it should honor your choices. You should also be able to "reset" this flag.
But in general, this is a very messy thing. It gets messier the more you think about it.
-- Erik Naggum, Oslo, Norway
Act from reason, and failure makes you rethink and study harder. Act from faith, and failure makes you blame someone and push harder.
>> Well storing a few extra bytes equal to the length of the symbol name >> wouldn't seem to be a problem then.
> Why would it need to do this? If I understand you correctly, you're > proposing that the reader preserve case, but that it uses a > case-insensitive INTERN.
In what I finally proposed the separate string would be determined at the time a symbol is interned (I'm now more familiar with this term). So to answer Nils question this separate string value would differ if files are loaded in a different order and the source files referred to the symbol using a different case.
This is of no consequence to existing code as I was NOT proposing that the reader uses a case-insensitive INTERN. I was just proposing that the original source names should be available as additional information to those who want to access them.
This would allow the original case of unescaped symbols to be retrieved by a function that is attempting to interface with a case sensitive system. The symbols could even be interned in advance using the correct case and then referred to in whatever case is desired (e.g. lowercase) throughout the rest of the Lisp code (e.g. you intern a symbol called StudyCaps once at the start of the code and are then able to refer to it as studlycaps throughout the rest of your code. Any function that accepts this symbol as a parameter is able to retrieve the original case).
So long as the foreign function calls to the system are unique when viewed in case insensitive terms there would be no mapping problem from the Lisp symbol to its original case. If the system you are trying to interface with is truly evil--where studycaps and StudyCaps are two completely separate functions--you would either have to start escaping symbols, use strings in the first place, or move to a case sensitive reader mode.
"Adam Warner" <use...@consulting.net.nz> writes: > Hi Thomas F. Burdick,
> >> Well storing a few extra bytes equal to the length of the symbol name > >> wouldn't seem to be a problem then.
> > Why would it need to do this? If I understand you correctly, you're > > proposing that the reader preserve case, but that it uses a > > case-insensitive INTERN.
> In what I finally proposed the separate string would be determined at the > time a symbol is interned (I'm now more familiar with this term). So to > answer Nils question this separate string value would differ if files are > loaded in a different order and the source files referred to the symbol > using a different case.
That is not enough. You need to tweak also the FIND-SYMBOL procedure to make the all thing work. Do a google on "SYMBOL-NAME-CASE" and look at the thread.
Remember that you can always use the READTABLE-CASE to :INVERT along with *PRINT-CASE* to :DOWNCASE to achieve some form of "mainstream case handling", however, the "MAKE-foo" thingy will still break.
> This is of no consequence to existing code as I was NOT proposing that the > reader uses a case-insensitive INTERN. I was just proposing that the > original source names should be available as additional information to > those who want to access them.
> This would allow the original case of unescaped symbols to be retrieved by > a function that is attempting to interface with a case sensitive system. > The symbols could even be interned in advance using the correct case and > then referred to in whatever case is desired (e.g. lowercase) throughout > the rest of the Lisp code (e.g. you intern a symbol called StudyCaps once > at the start of the code and are then able to refer to it as studlycaps > throughout the rest of your code. Any function that accepts this symbol as > a parameter is able to retrieve the original case).
> So long as the foreign function calls to the system are unique when viewed > in case insensitive terms there would be no mapping problem from the Lisp > symbol to its original case. If the system you are trying to interface > with is truly evil--where studycaps and StudyCaps are two completely > separate functions--you would either have to start escaping symbols, use > strings in the first place, or move to a case sensitive reader mode.
All of this is along the lines of what I thought about in my proposal. Note however, that it is an extension to ANSI.
Cheers
-- Marco Antoniotti ======================================================== NYU Courant Bioinformatics Group tel. +1 - 212 - 998 3488 715 Broadway 10th 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'.
* Paolo Amoroso | That's good advice. But leaving the troll's claims unchallenged may give | the wrong messages to those with limited or no Lisp background who may later | happen to check the comp.lang.lisp archive. What do you think?
I think the desire to correct mistakes and help those who appear to believe in falsehoods is the driving force behind every useful contributor to Usenet. The educator personality cares about the state of the information individual people hold and about the aggregate state of the information in a community.
The more passionately you care about something, the more time and effort you expend to make sure other people get it right, too. Repeated myths, unfair claims, misrepresentations, outright lies, etc, cause you to defend what you care about, to set the record straight. Passion is a double-edged sword, though. You cannot both care strongly and always be nice towards the people who cause you to feel a rush to correct their misstatements and especially towards the idiots who refuse to listen despite your efforts to correct their mistakes. It is precisely because people care so much that they keep the high level of discourse /and/ fall victim to the trolling idiots. Were there little to value and care about and protect, nobody would bother to waste time on some obnoxious idiot who is unlikely to change his mind no matter what people do in the belief that they help him, because he is simply not after the same kind of social interaction as those who care about truth and honesty and justice and correct information. Their kind of community is one
where people feel each others' pain. In the general population, this kind far outnumbers the rational type that benefits from technical discussions, arguments, and getting things straight. The former would, in effect, rather remain misguided than hurt by realizing it, while the rational course of action is to realize that you will inevitably be hurt when you are wrong and therefore seek to learn as much as possible as early as possible even though it may hurt briefly when you are wrong.
This is not just a clash of intentions. It is a clash of personality types. When one type benefits from a heated argument and relishes the chance to learn something new by challenging his own beliefs and skills and knowledge -- which does not happen too often in so-called "friendly environments" , the person who seeks others for company and sharing pain and body heat will wimper under the table and not even understand that there is a valuable exchange going on, partly because the technical arguments are involved and esoteric and he could not even bring himself to consider the possibility that people feel strongly about anything so "impersonal" and "rational".
For the trolls are also passionate -- passionate /anti-thinkers/ who defend their "right" not to think with much stronger emotions than anyone will defend something they care about rationally. If you think about something and your purpose is to understand and figure things out, you will also understand when it is in your best interest to back down -- you hold on to something only as long as you have good reasons to do so. Some people love the all-out war that goes on in court rooms and real public debates, while others have neither the commitment nor the inclination to engage in any sort of fight over what they believe in--because they do not believe in anything, and if they believe in something, it will be primitive, concrete things and not abstract ideas or principles. Some idiots will harrass those they see as instigators of "trouble" and whine "can't we all just get along" while they feel strongly enough about disallowing passionate arguments that they stage wars over some feel-good etiquette. This is all "rational" to them, because their core premises are that people should be friendly and not hurt one another, communities should be support groups and pain-sharing fora, and that it is more important to blend in than to be someone and something. It is therefore perfectly legitimate in their warped, anti-social world-view to attack people who want something other than they want out of a forum, but since they are not principled, this is obviously not extended to anyone else.
It took me some time to realize this, but people who run on faith do not accept failure or correction as part of their life experience -- they just believe /stronger/, probably believing that their faith is tested or whatever and that it is important not to "lose their faith". Faith alone is not the problem; the problem is what you have faith in. Primitive people have faith in what rational people want to know as facts, and they do not understand that advanced people have faith in abstract and general principles, instead. Faith in human nature, in the ability of reason to understand the world we live in, in universal human rights, etc, are good things to believe in, but very primitive people will only raise to such principles to argue "freedom of expression" when they are asked to stop posting drivel such as UFOs or alternative medicine or conspiracy theories. They probably really feel they are expressing themselves when they post falsehoods and whine in public and that people who want to shut them down are evil because they refuse to share their pain and ask them to go suffer in solitude. Morons who come to this newsgroup to whine about not being able to use Common Lisp do /not/ want people to help them use Common Lisp. They want people to feel sorry for them and comfort them, and what rational people think is helpful, such as showing them that they can in fact use Common Lisp, is just making things worse for these poor suckers: not only do they feel bad, they are told they are wrong to feel bad. We even have people who come to Usenet because they have no friends and feel lonely and hope Usenet can fix that. I am reminded of a quotation attributed to Mark Twain: "If you can't stand being alone, you probably bore other people, too."
What makes a troll is the lack of basic introspection and thinking skills. They literally have no idea how they arrived at their stupid opinions, where their notions come from, how their ideas work together, indeed /that/ things they know are supposed to make up an integrated whole, but they are all emotional about having the "right" to express these vacuous opinions. This means that if you find out how they arrived at their positions, you know more than they ever will. Since any good argument must dig deeper than the words on the surface to uncover purpose and meaning and especially where any mistakes were made, just starting to talk seriously to these guys will cut through them like a bullet through hot butter and this is undoubtedly a very frightening experience to them, which is probably a contributing cause of the troll's behavior. People tend to respond irrationally when they are in a situation from which they do not understand how they can escape, feeling like threatened animals with the flight-option ruled out. However, that this is possible with something you read off of your computer should probably be the topic of some serious research into human psychology. The reader has to construct the threat from his own conclusions about what other people intend and usually also what they actually do. More often than not, a reader has felt threatened by something the writer did /not/ intend or even do. The sheer lack of precision in recounting the story of what happened and the amazing amount of /invented/ hostility that they impute to their enemy in order to feel that it is acceptable to attack in return should have been able to tell people something about themselves.
So I think trolls are basically your average non-thinking guy whose brain works on the default settings and who has no general or specific clue about anything, but has moderately successfully stumbled through life without ever achieving an intellectualy stimulating experience. Faced with the prospect of being required to think, his first reaction is along the lines of "you're not the boss of me", that nobody has the /right/ to demand anything of him, but he has the /right/ to express himself freely without any such demands. To the non-thinking average joe with no inclination to engage his brain before his mouth, the demand that he think will necessarily feel like, and indeed be, limiting on his freedom of expression. The demand that he know what he talks about will likewise reduce his ability to voice his opinions. Now, instead of feeling that his rights are abrigded, he could exercise the opportunity to learn and listen, but this is where the troll differs from the rest of the average joes: He has something on his mind and he will not allow anyone to change the subject. A modicum of fanaticism will make the troll continue to annoy people precisely /because/ they ask him to go away, as he sees the abridgment of the God-given right to speak his mind whatever might be on it, wherever he wants to speak.
The only way these people will shut up is when their desire to speak their mind is /not/ met by criticism of its contents. They have spoken, it was wrong and misguided, but anyone who read it and thinks about the lack of intellectual effort on the part of the writer and his lack of interest and desire to listen and learn new things that must have manifested itself before they could have made the statements they made, should realize that there is no point whatsoever in trying to help this individual. With terabytes of high-quality information available on the Internet both for free and for very small fees, with millions of books available in libraries
* Marco Antoniotti | Remember that you can always use the READTABLE-CASE to :INVERT along | with *PRINT-CASE* to :DOWNCASE to achieve some form of "mainstream | case handling", however, the "MAKE-foo" thingy will still break.
`*print-case*´ is actually not obeyed when `(readtable-case *readtable*)´ is `:invert´ or `:preserve´.
-- Erik Naggum, Oslo, Norway
Act from reason, and failure makes you rethink and study harder. Act from faith, and failure makes you blame someone and push harder.
Erik Naggum <e...@naggum.no> writes: > * Nils Goesche > | So, the printed representation is determined at the time a symbol is > | interned?
Essentially. This whole idea is sort of in the "cool things one might do with the language" category, not really a system I'd want to do my day-to-day work in.
> The time of first read seems like a better option. That is, only the reader > should remember the case to be preserved. This might involved some more > housekeeping information.
Yes, I was thinking something like an extra argument to INTERN, or a dynamic variable to control whether this was an "ordinary" call, or a "reader-like" one.
> | If yes, suppose I have two files containing our symbol. Once it is written > | `foo', once `Foo'. Will the printed representation now depend on the order > | the files are loaded?
> It might, but again, I think the first time you write a symbol's name, it > should honor your choices. You should also be able to "reset" this flag.
> But in general, this is a very messy thing. It gets messier the more you > think about it.
Yick, no kidding.
-- /|_ .-----------------------. ,' .\ / | No to Imperialist war | ,--' _,' | Wage class war! | / / `-----------------------' ( -. | | ) | (`-. '--.) `. )----'
> "Ng Pheng Siong" <n...@vista.netmemetic.com> wrote in message > news:akioh7$20i$1@mawar.singnet.com.sg... > > According to Kaz Kylheku <k...@ashi.footprints.net>: > >>about Lisp having a fixed syntax which forces you do to things one > >>way, such as to keep nesting deeper and deeper if you want to > >>introduce a series of lexical variables which refer to earlier > >>lexical variables, and have code interspersed in between?
> >I'm a Lisp newbie, and I am producing code that looks like this. > >What are the better alternatives? Enquiring minds want to know! ;-)
> Why not post some code you're not happy with and ask for suggestions?
Well, I'm not particularly bothered by my code that looks like this; just that I had read Kaz K to mean there are other ways, so I'm curious about it.
I've been browsing code such as CMUCL's. I'm noticing the same style here and there, and now I'm even less bothered by it. ;-)
>This is because you're having to think up (Lisp is higher level than >C or Java). I had the same problem with Prolog, which is higher level >than Lisp, but I persevered, and after heavy use grokked it.