In article <sfwit7tsr3a....@shell01.TheWorld.com>, Kent M Pitman
<pit...@world.std.com> wrote: > A happy outcome for me in this would be an agreement to just refer to > scheme symbols, at least in a language-neutral discussion, as > "keywords" and not really as "symbols".
I am happy to adopt this terminology. Ironically, I think this issue arises because we are having a symbol clash in our natural language. We're all using the word "symbols", but half of us mean scheme::symbols and the other half mean common-lisp::symbols. But both sides intern the string "symbol" and when they come together the resulting confusion is the socialogical eqivalent of:
> Error: Using #<Package "Scheme"> in #<Package "COMMON-LISP-USER"> > would cause name conflicts with symbols already present in that > package: SYMBOL SCHEME:SYMBOL
Rephrasing my question in this terminology then: I have always understood the need for packages in order to preserve backwards compatibility with existing software like Maxsyma. However, with that motivation alone one can reasonably view packages not as a feature that is desirable in and of itself, but as a hack that is needed in order to incorporate old code that was written back when people didn't understand as much about software engineering as they do now. *IF* we had it to do over again (I recognize that we don't) we might, with the benefit of hindsight, end up with a design that doesn't have packages.
Until recently I thought this was the dominant view in the CL community, but I have recently discovered this is not so. Many people believe that packages are a feature in and of themselves, that they provide some benefit independent of any legacy considerations, that if they had it to do over again they would still incorporate packages into the design. I am now trying to understand that point of view.
So far, the arguments I have heard advanced for the second point of view have seemed to me to be more philosophical than technical, going something like: "You need packages in order to support symbolic processing," where "symbolic processing" is *defined* as computing with common-lisp::symbols. I grant that argument, but it just begs a different question: why is "symbolic processing" thus defined a good idea? What does common-lisp::symbolic-processing buy you that scheme::keyword-processing does not?
Note that by restating the question I do not mean to imply that it hasn't already been answered. Kent has written at length about this, but it's taking me some time to digest everything he's had to say. (I still have to get some actual work done between newsgroup postings.)
Maybe what I've been doing these many years that I have always thought of as symbolic processing is really scheme::keyword-processing (except that I've been doing it in Common Lisp and not Scheme).
* Erann Gat | This, like much of Erik's rhetoric, is so ridiculous as to barely deserve | response.
I marvel at the psychological problems that produce your need to respond.
| Being lectured on arrogance by Erik is so funny that words fail me.
I would much prefer they _actually_ did.
| Erik, you should really stop confusing not listening to *you* with not | listening to anyone.
You take the time off from your productive life to complain that people say bad things about you and you do not find _yourself_ ridiculous when you spend an _enormous_ amount of time badmouthing me to the point that people who do not even know me cannot figure out what I could possibly have done to cause your psychotic break and the scary monsters you see.
What if you tried to understand what I say, Erann? What dangers are your mind protecting you from when it shut down and you consistently fail to listen? How much truth have I _really_ said about you that you need to pretend so much? It is obvious that I have really freaked you out -- into some kind of self-protective position where you _have_ to pretend that what I say is so "ridiculous" and "funny" that you do not have to look too closely at it. These are quite obviously defense mechanisms.
Just cut it out. Get over whatever it was that hurt so badly and move the hell _on_, dude. Whatever it is that I can do that hurts so much only gets worse every time you stupidly decide to attack me to feel better. If not, it would have worked and you would have quit, right?
/// -- 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.
g...@jpl.nasa.gov (Erann Gat) writes: > ... one > can reasonably view packages not as a feature that is desirable in and of > itself, but as a hack that is needed in order to incorporate old code that > was written back when people didn't understand as much about software > engineering as they do now. *IF* we had it to do over again (I recognize > that we don't) we might, with the benefit of hindsight, end up with a > design that doesn't have packages.
No. I would not recommend that anything be changed in the design of Macsyma. I think it was designed very reasonably and I don't want compatibility for their code, I want compatibility for their design paradigm, which I consider an important one.
> Until recently I thought this was the dominant view in the CL community, > but I have recently discovered this is not so. Many people believe that > packages are a feature in and of themselves, that they provide some > benefit independent of any legacy considerations, that if they had it to > do over again they would still incorporate packages into the design.
Yes, that's right.
> I am now trying to understand that point of view.
I thought you were already to that point actually, but ok.
> So far, the arguments I have heard advanced for the second point of view > have seemed to me to be more philosophical than technical, going something > like: "You need packages in order to support symbolic processing," where > "symbolic processing" is *defined* as computing with > common-lisp::symbols.
No. It is defined as "computing with symbols that can be viewed simplistically AS IF they had no package while being developed and while no interaction was needed with other modules, but that can still be shared or separated as appropriate with other applications when the need for interaction arises". CL packages are the only kind of symbol data that implement this goal.
> I grant that argument, but it just begs a different > question: why is "symbolic processing" thus defined a good idea?
It isn't. You've defined it badly.
> What > does common-lisp::symbolic-processing buy you that > scheme::keyword-processing does not?
The ability to ignore identity issues beyond your own sandbox while you develop things. The ability to just say (integrate '(sin x)) without worrying that the Christian church will have a different meaning of SIN but another math package may share the same meaning.
> Note that by restating the question I do not mean to imply that it hasn't > already been answered. Kent has written at length about this, but it's > taking me some time to digest everything he's had to say. (I still have > to get some actual work done between newsgroup postings.)
Heh. So do I, believe it or not. I just had a well-timed activity lull for work in the last couple of days, so had enough time to pursue this in depth.
> Maybe what I've been doing these many years that I have always thought of > as symbolic processing is really scheme::keyword-processing (except that > I've been doing it in Common Lisp and not Scheme).
Maybe. But maybe not.
Scheme always shares all symbols with all others having the same name. CL allows you to chose whether you will or not.
Being pro-choice doesn't mean being pro-abortion. It means reserving the right to take one or the other action. The pro-life term "pro-abortion" incorrectly characterizes the others' movement as always favoring abortion even though some pro-choicers have never had an abortion and never would; they simply tolerate choice. Ironically, the pro-choice movement applies the term "anti-choice" which does, I think, objectively describe their political opponents.
Being pro-choice in symbol separation doesn't mean either always sharing your symbols with others or always separating them. It means getting the choice on a case-by-case basis. Don't make the mistake of thinking that the opposite of pro-share [the Scheme point of view, with alias "anti-choice"] is pro-separation. Nothing about the CL approach keeps you from doing what Scheme does. But the Scheme approach keeps you from doing what CL does, at least with any data type called symbol.
And, as often happens, it becomes a war over who gets legitimate use of the word.
It's worth noting, going back to the abortion debate, that the argument is so intense that there have been reports of advocacy organizations purchasing and otherwise influencing dictionaries in order to get subtle changes in the definition of "life" so that they can influence the debate on this matter, since some people actually reason based on the words, rather than on their target meanings.
Words matter. Refined control of when they bind is critical.
There was an occurrence of this name-bonding thing in the design of ISLISP actually. When WG16 was first working on an international standard, we got together and talked about what its nature should be. One national representative (I'll spare that person the embarrassment of mentioning his country of origin) said to me privately "I don't care what's in the standard. I care only that the standard is called Common Lisp." "Why?" I asked, puzzled. "Because I am a consultant and have told a client that Common Lisp is the future. If the standard we make is called Common Lisp, whatever its content, then I have told the truth. It doesn't matter what's in the language, only that the words I said were true. If what we make has the semantics of Common Lisp but is called something else, I will have given bad advice." So you see, late-binding the meaning of a name ("Common Lisp" in this case) may be helpful to some (this representative), but is not helpful to all (his client, the committee, ...). It's a point of view thing.
[I'll leave aside as irrelevant to this point an analysis of the fact that this person, whose country had so little interest in the language that they would let someone with this "design motivation" sit on a committee, got the same "one vote" in the design of an international lisp standard as the United States, who had done by then 30 years and hundreds of millions of dollars worth of business in the same arena.]
I know I shouldn't be continuing on this thread, but....
g...@jpl.nasa.gov (Erann Gat) writes: > So far, the arguments I have heard advanced for the second point of view > have seemed to me to be more philosophical than technical, going something > like: "You need packages in order to support symbolic processing," where > "symbolic processing" is *defined* as computing with > common-lisp::symbols.
No, it's defined as computing with symbolic identifiers. CL symbols are an example of such objects which can be used when multiple applications are around. Scheme symbols are not.
> I grant that argument, but it just begs a different > question: why is "symbolic processing" thus defined a good idea? What > does common-lisp::symbolic-processing buy you that > scheme::keyword-processing does not?
Why do we want modules in scheme? To allow each application to associate different values with the same identifiers.
Why does symbolic processing require the namespacing of symbols? Because we need to allow different applications to use their natural terminology, and manage conflicts and similarities among them.
-- -> -/ - Rahul Jain - \- <- -> -\ http://linux.rice.edu/~rahul -=- mailto:rj...@techie.com /- <- -> -/ "Structure is nothing if it is all you got. Skeletons spook \- <- -> -\ people if [they] try to walk around on their own. I really /- <- -> -/ wonder why XML does not." -- Erik Naggum, comp.lang.lisp \- <- |--|--------|--------------|----|-------------|------|---------|-----|-| (c)1996-2002, All rights reserved. Disclaimer available upon request.
> > > > This is obviously not quite kosher in a file.
> > > Sure it is. I don't know what you're talking about. I have files that > > > say just exactly that. (Well, different function and package names.)
> > But when you load the init file, the reader ought to fail because > > there is no package named `java-tools' at the time the reader reads > > the init file. Never mind that java-tools:make-all *will* be a > > fine thing to invoke *after* we load "java-tools.lsp". (I have verified > > this on ACL and Corman.)
> This is IMHO not true. The loader must process the forms one by > one, including the reader. Otherwise forms such as (in-package :foo) > would not work in loaded files.
I excerpted too much. The init file had this in it:
In article <a75jld$b6...@news3.cadvision.com>, "Wade Humeniuk"
<humen...@cadvision.com> wrote: > When it comes to programming languages I try to not attach words like evil > to them.
So do I. "Necessary evil" is an idiomatic expression in English. In common usage it doesn't have the same kind of pejorative connotation as the word "evil" used in isolation. It means something more like "compromise that no one is really very happy with but which is the most expedient route to a common goal."
> I can think of three quick approaches to learning about packages is by:
> 1) Using it, getting familiar with it, trying it out (in real situations), > is one way to get a feel for what the designers had in mind.
I've been using it for over fifteen years. How long does it take? I've used it on software that controlled a $200,000,000 spacecraft. How real does it have to be?
> 2) Trying to develop a package system yourself. With this approach you get > immediate insights into the ideas and problems behind it.
I don't see the benefit in this. I'm not questioning the design of the package system. I'm questioning the nature of its utility.
> 3) Teaching the subject. This forces you into actually learning the > material so you do not fall apart when the first challenging question comes > around.
Done that too. I've even been paid for it.
> It is more respectful to strive to comprehend by the above 3 methods (and > then asking questions) than asking critical questions based on just > curiousity.
I agree. I also think it's pretty disrespectful to assume that I have done anything other than that.
> In article <a75jld$b6...@news3.cadvision.com>, "Wade Humeniuk" > <humen...@cadvision.com> wrote: > > 2) Trying to develop a package system yourself. With this approach you get > > immediate insights into the ideas and problems behind it.
> I don't see the benefit in this. I'm not questioning the design of the > package system. I'm questioning the nature of its utility.
I do not understand this statement. The package system has a well defined interface (protocol). Its behavior is predictable. It does what it is designed to do. Does it not do something that you need done? I have not needed more than the package system provides. What more utility does one need? To make a concrete programming language limitations have to be accepted. Just as one can design arbitrarily complex physical objects, the actual physical objects than can be produced is limited by machining capabilities. So it is with programming languages.
What needs do you have for packages and symbols that is not being net? I do not have any additional needs so there is no driving force for me to do anything. What is driving you?
From your original post I saw:
>> foo >ERROR: foo is unbound ; Doh! Forgot that foo is in foo-package >> (use-package 'foo-package) >ERROR: symbol FOO-PACKAGE:FOO conflicts with symbol FOO ; Arrggh!!!
Usually when I make this mistake I back out completely using delete-package and reinitialize. I just try to be careful and take my time or load everything in my initialization file so everything is set up before I start. (LispWorks prompts you to resolve the problem anyways if you mistakenly do it). I have the comaparable problem if I do not insert the fuel nozzle into the gas tank before I pull the handle, I just have to or bad consequences result.
* Joe Marshall | I understand this. What the package-system doesn't understand is that | when I mentioned `foo' the first time (and got the unbound variable) was | that I *didn't* want that symbol. (Yeah, I know it cannot read my mind.)
But if you typed it into the REPL, you must have been in the wrong package to begin with. Why is that? My guess is that you were in the common-lisp-user package and called use-package instead of changing the current package to a well-defined package that uses the packages you have defined. I think you should be using in-package instead of use-package.
In my opinion, you are using the package-system counter to its design when you randomly call use-package, regardless of whether it is because of this "error". I tend to think it is just plain wrong to use the package operations interactively unless you are working to piece together a package in order to dump it to file prior to defining anything that depends on it having properly been set up. In other words, you have a broken package definition to begin with when you need to call use-package to "fix" it. And this is most likely the wrong "fix", too.
You have probably thought that use-package is something very different than it is and are now frustrated that it is not what you think it is, but what you think and what it is are probably close enough not to give you a strong enough hint that you need to revise your concept of what it is. May I suggest that you do a refresh read of the package concepts in the standard to see that your assumptions are actually valid?
I tried to remember when I ran into problems like you describe, but it is quite hazy to me. I must have changed the way I use Allegro CL compared to how I used CMUCL. In particular, if I try to evaluate an unbound variable in ACL, I get these restarts:
(52) cl-user foo Error: Attempt to take the value of the unbound variable `foo'. [condition type: unbound-variable]
Restart actions (select using :continue): 0: Try evaluating foo again. 1: Use :foo instead. 2: Set the symbol-value of foo and use its value. 3: Use a value without setting foo. 4: Return to Top Level (an "abort" restart). 5: Abort entirely from this process.
CMUCL is quite deficient in the restart department:
* foo
Error in KERNEL::UNBOUND-SYMBOL-ERROR-HANDLER: the variable FOO is unbound.
Restarts: 0: [ABORT] Return to Top-Level.
Debug (type H for help)
(EVAL FOO) Source: ; File: target:code/eval.lisp
; File has been modified since compilation: ; target:code/eval.lisp ; Using form offset instead of character position. (SYMBOL-VALUE EXP)
I had to go through a manual apropos call to get the equivalent of restart 1 in ACL above. That would be annoying, but this is a quality of implementation issue with CMUCL, not a design issue with packages.
CMUCL does not by default print the package name, and there is no convenient way to change the package, so it seems to me that your having adopted this abuse of use-package may well be an history artifact and that you should now use in-package, instead.
* Kent Pitman
> It preserves the illusion that all symbols always exist > by demand-creating any symbol upon mention.
| The illusion is imperfect. When I (use-package ..) I can tell if a | symbol had been created on demand or not: I get errors for those that | were.
Really? This would only be true of all symbol names were always distinct regardless of the package system. Since this is obviously false and a use-package therefore can signal an error caused by two well-defined symbols in both packages, there is something wrong with your premises.
I think your _premise_ is that the package system is broken and now you are only trying to find ways to "prove" it by doing things that would break _any_ working system. I consider this prejudicial.
| No, I don't want a DWIM. What I do want is something that is a bit more | clever. Consider this behavior: when I make a typo and get an unbound | variable error, why not have the system unintern the symbol just created | if and *only if* it was created by the typo itself.
Would you want the reader to record the second value of intern for each symbol it has interned and make them available to the evaluator so it can safely unintern a symbol that causes a symbol and search all packages for a symbol with the same name and suggest them to you in case the user is unable to set up the package-system so it produces user-correct results?
This sounds like a really bad solution to the wrong problem.
| These two behaviors (and note that I'd like that latter to be a user | controlled switch so no one *has* to monitor the load process | looking for these things) would greatly improve my relationship with the | package system.
The user-controlled switch exists and is called defpackage. If you do not use an in-package form in your compiled source files, I think you deserve to lose, and if your package definitions are out of sync with respect to their actual interdepencies, even more so.
/// -- 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.
> > > No. The critical value is the ability to TYPE the symbol without > > > doublequotes or other impediment in most cases.
> > I presume you mean "type" as in the action of pushing keys on a keyboard, > > not "type" as in data type.
> Yes.
> > This sounds like you're saying that being able to type:
> > 'FOO
> > is significantly better (on *technical* grounds) than having to type:
> > (setf foo (make-symbol-object :name "foo"))
> Yes.
> Though actually you meant to say > (or (find-symbol-object-named "foo") > (make-symbol-object :name "foo"))) > or perhaps just > (intern "foo") > since that's what INTERN does. As to whether a SETQ is done or not, > that's a context thing in code; because of INTERN, the SETQ is sometimes > not needed.
Actually, I meant what I wrote. I used "make-symbol-object" deliberately because I wanted to set the variable foo to an object that had the same properties (meant colloquially, not in the sense of plists) as a symbol but not actually *be* a symbol.
> Because although designed before there was an issue over this, its importance > came to be understood later as a counter-theory to what we came to know > as "procedurally embedded data". The more information one can put into > data, the less is in the code. That in turn leads (not all at once but in > many tiny design steps) to the notion of the program that is reprogrammable > without recompilation. Every time you pull a decision back into the code, > you must recompile the code in order to change that decision. I'm not saying > that every datum in a program should be symbolic, but I am saying that in the > cases where people make that information symbolic, there is substantial > opportunity to revise the program behavior by merely pushing symbols around.
Ah!
One of the great things about CL (or at least MCL, which is the CL environment I've used since the mid-80's) is that recompiling small parts of the code has essentially zero cost. (I believe this is true of CL in general, but I don't have enough experience in other environments to be sure.) Because of this, perhaps, I do not perceive having to recompile some code when I change a design decision as a problem. (And I make a *lot* of design changes while coding. In fact, one of the sources of friction I have with some of my colleagues is that I think that design and coding ought to be much more finely interleaved than they do.)
> Show me a worked example and I'll be clearer.
Could you suggest a target problem for me to work?
> > Have you read Drew McDermott's paper "Artificial Intelligence Meets > > Natural Stupidity"? ... > I have no info. Is it webbed?
Alas no, but here's the citation: Drew McDermott. Artificial intelligence meets natural stupidity. In: Haugeland mind-design, pages 143-160. Originally in SIGART Newsletter No 57, 1976.
It's a good read even today.
> I keep saying "identity".
Yes, I've noticed that. I can't quite figure out what you mean by that because all Lisp object have identity, not just symbols.
Erik Naggum <e...@naggum.net> writes: > In my opinion, you are using the package-system counter to its design > when you randomly call use-package, regardless of whether it is because > of this "error". I tend to think it is just plain wrong to use the > package operations interactively unless you are working to piece together > a package in order to dump it to file prior to defining anything that > depends on it having properly been set up.
I completely agree with this.
Though the design was initially bad having only those stupid package operations (which should always have been only subprimitive to DEFPACKAGE and its ilk, to error correction, etc.) so I don't know if counter to its design is quite how I'd say it. I'd say "counter to what has become good practice" ;)
> In other words, you have a > broken package definition to begin with when you need to call use-package > to "fix" it. And this is most likely the wrong "fix", too.
Right.
> You have probably thought that use-package is something very different > than it is and are now frustrated that it is not what you think it is, > but what you think and what it is are probably close enough not to give > you a strong enough hint that you need to revise your concept of what it > is. May I suggest that you do a refresh read of the package concepts in > the standard to see that your assumptions are actually valid?
Or better yet, never ever use these things and only ever use DEFPACKAGE and IN-PACKAGE.
> > Though actually you meant to say > > (or (find-symbol-object-named "foo") > > (make-symbol-object :name "foo"))) > > or perhaps just > > (intern "foo") > > since that's what INTERN does. As to whether a SETQ is done or not, > > that's a context thing in code; because of INTERN, the SETQ is sometimes > > not needed.
> Actually, I meant what I wrote. I used "make-symbol-object" deliberately > because I wanted to set the variable foo to an object that had the same > properties (meant colloquially, not in the sense of plists) as a symbol > but not actually *be* a symbol.
I don't mean literally INTERN in the above, btw. I meant intern-symbol-object-named. Still, just one function call consolidating the FIND-OR-MAKE idiom.
But interning somehow is the CRITICAL part. Otherwise, (LIST 'A 'A) becomes (LIST '#:A '#:A) which is a very different thing because it contains no duplicates and hence no info shared between list elements.
> One of the great things about CL (or at least MCL, which is the CL > environment I've used since the mid-80's) is that recompiling small parts > of the code has essentially zero cost. (I believe this is true of CL in > general, but I don't have enough experience in other environments to be > sure.) Because of this, perhaps, I do not perceive having to recompile > some code when I change a design decision as a problem.
Then you have never tried to deliver code under certain vendors' licenses that forbid the presence of the compiler without large additional cost.
But, moreover, for building embedded rule-driven languages, there is simply no need to manipulate compiled code.
And anyway, no matter how easy it is, no one but the program maintainers has any business manipulating the code in my package. But I may publish data descriptions they can manipulate.
Also symbols externalize even if functions don't. (And if functions externalize, it's only because secretly they use names of symbols internally, because otherwise if you tug on certain functions, all of creation goes out to a file...)
> (And I make a > *lot* of design changes while coding. In fact, one of the sources of > friction I have with some of my colleagues is that I think that design and > coding ought to be much more finely interleaved than they do.)
> > Show me a worked example and I'll be clearer.
> Could you suggest a target problem for me to work?
> > > Have you read Drew McDermott's paper "Artificial Intelligence Meets > > > Natural Stupidity"? > ... > > I have no info. Is it webbed?
> Alas no, but here's the citation: Drew McDermott. Artificial intelligence > meets natural stupidity. In: Haugeland mind-design, pages 143-160. > Originally in SIGART Newsletter No 57, 1976.
> It's a good read even today.
> > I keep saying "identity".
> Yes, I've noticed that. I can't quite figure out what you mean by that > because all Lisp object have identity, not just symbols.
But only symbols have a name registry that interns them.
Actually, in Zetalisp, pathnames also get interned.
Identity is still of value with each object distinct, but symbosl are about naming and there's less point really to name something you won't be using again.
"Eduardo Muñoz" <e...@jet.es> writes: > Kent M Pitman <pit...@world.std.com> writes:
> > Because mine is not the only opinion here and much though I have a desire > > to offer my arguments, I have no desire to offer them against a vacuum.
> But there isn't a vacuum here. I read this > newsgroup every day with the hope of reading code > or practical examples of CL solutions and I must > say that your last three posts (that I have > bookmarked) have given me a lot of food for > thought.
I must say, I've also quite enjoyed some of your posts in this thread, Kent. I can definitely see why you feel you're talking into a big void, and I've been wondering when your posting stamina was going to run out. But you have offered a few gems that have kept me slogging through an otherwise-tiresome thread (I think that's a good thing :)
-- /|_ .-----------------------. ,' .\ / | No to Imperialist war | ,--' _,' | Wage class war! | / / `-----------------------' ( -. | | ) | (`-. '--.) `. )----'
"Joe Marshall" <prunesqual...@attbi.com> writes: > "Rahul Jain" <rj...@sid-1129.sid.rice.edu> wrote in message news:87sn6yzq4n.fsf@photino.sid.rice.edu... > > Identifiers in Lisp are symbols.
> Yes, but the vast majority need not be. If I write this:
> The identifier X is interned as a symbol, yet the code does not use > the value cell, function cell, print name, package, or plist. Not > only that, but the identity of the identifier need not even last > beyond the compilation! However, were I to enter that function, > and then attempt to import a symbol named X from another package, > I'd get a name conflict. What is conflicting?
But that's not a language requirement. It would be possible to write a repl and a file compiler that would keep track of what symbols would have been compiled away, and would unintern them if they weren't there before. Actually, that would be a pretty cool feature, come to think of it ... not cool enough for me to actually go and do it, but I like the idea :)
-- /|_ .-----------------------. ,' .\ / | No to Imperialist war | ,--' _,' | Wage class war! | / / `-----------------------' ( -. | | ) | (`-. '--.) `. )----'
"Joe Marshall" <prunesqual...@attbi.com> writes: > No, I don't want a DWIM. What I do want is something that is a bit > more clever. Consider this behavior: when I make a typo and get an > unbound variable error, why not have the system unintern the symbol > just created if and *only if* it was created by the typo itself.
> Or this: When loading a fasl file (with appropriate switches) > the following error appears:
> The symbols 'frob', 'tweak', 'twiddle', and 'transmogrify' are > not currently visible in package FOO, but package UTILITY exports > symbols of these names. > 1: IMPORT just those symbols from UTILITY > 2: USE-PACKAGE utility. > 3: Create new symbols in package FOO.
> These two behaviors (and note that I'd like that latter to be a user > controlled switch so no one *has* to monitor the load process > looking for these things) would greatly improve my relationship with the > package system.
It sounds like you just want a kinder, gentler repl. I don't see why you couldn't have that with the existing package system.
-- /|_ .-----------------------. ,' .\ / | No to Imperialist war | ,--' _,' | Wage class war! | / / `-----------------------' ( -. | | ) | (`-. '--.) `. )----'
> > Then you have never tried to deliver code under certain vendors' licenses > > that forbid the presence of the compiler without large additional cost.
> That's an argument for free software, not an argument for packages.
And free software is an argument for certain people, me in particular, to find another profession. In which case you wouldn't be having any of this conversation with me, at least. That would simplify things too.
So while I'm here, since I exist only in worlds where software for fee is a given, let's hypothesize this as a given. If you want to start a thread on why we don't need both software for pay and also Kent, that's fine.
But let's not make the same reasoning errors that a perceptron would by assuming you can mix and match the parts of the world you want and have no logical interconnections between the changes for the sake of consistency.
Bruce Hoult <br...@hoult.org> writes: > In article <sfwg02x4dq2....@shell01.TheWorld.com>, > Kent M Pitman <pit...@world.std.com> wrote:
> > To quote a childhood mantra: "almost only counts in horseshoes and > > hand grenades"
> I know that from my childhood as well, but only because Col. Potter said > it a lot.
> Is that *really* a common expression, somewhere?
I use it quite a bit when bowling (stupid game:-), but I usually substitute "close" for "almost".
I've heard the atom bomb addendum, as well.
[sorry for continuing off-topic; couldn't resist ... ]
-- Duane Rettig Franz Inc. http://www.franz.com/ (www) 1995 University Ave Suite 275 Berkeley, CA 94704 Phone: (510) 548-3600; FAX: (510) 548-8253 du...@Franz.COM (internet)
> > > > > This is obviously not quite kosher in a file.
> > > > Sure it is. I don't know what you're talking about. I have files > that > > > > say just exactly that. (Well, different function and package names.)
[...]
> I excerpted too much. The init file had this in it:
You didn't excerpt, it was Kent that said that _he_ prefered to use the two form version, which does work, instead of the ugly hack you had proposed, in order to use one form. And it was Kent's version which you claimed was not quite kosher. Please take more care in reading what you are arguing against, otherwise it gets very hard to separate valid arguments from FUD.
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
g...@jpl.nasa.gov (Erann Gat) writes: > [...] > * Nicolas Neuss:
> > Your CV looks impressive, but after having this conversation with you > > and reading so much about your problems on c.l.l., I do not believe > > anymore that it tells the truth.
> Wow. I've been accused of a lot of things, but this is the first time > anyone has actually accused me of fraud. Nicolas, I will provide you with > documentation for any claim on my CV that you find questionable with the > proviso that if I do so you must agree to apologise pulicly for defaming > me. (Actually, you can verify everything on there yourself if you wish, > and you would have been well advised to do so before making your libelous > acusation.)
I think you are right here. I apologize. As much as I see the data given on http://www.flownet.com/gat/resume.html can be certified and is therefore probably correct. My doubts were more directed towards your "How I lost my faith"-post and your recent questions. That is:
1. How can anyone do a reasonable Lisp development without understanding AND ACCEPTING the package mechanism which you started a discussion about?
2. How can anyone work successfully together with other people at JPL or at Google, when he has such difficulties in understanding other people? What I hoped with my question was that someone who actually worked with you (e.g. Norvig at Google) could clarify things.
3. Why do you have to follow up every damned message you do not understand (and these are plenty) asking for further elaboration? Why can't you simply accept answers people give here, ponder them several days (at least) and WORK FOR YOURSELF to acquire sufficient knowledge for continuing. As much as I remember you told us that you do not actively work with CL anymore, so I get the impression that you want the people here to teach you without the pondering and working step you should do. I do not see how I could work together with someone doing that constantly, so I hoped that some colleagues of yours could explain it to me.
Kent M Pitman wrote: > CL allows me, simply in the symbol data, to control whether I'm doing various > kinds of sharing. For example, I can separate my spaces, as in:
> - The information is manifest in symbols, a primitive data structure > in the language > - Both the objects and the properties can be named by symbols, > which are easy to type. > - When debugging either the PEOPLE or FLOWER package, you don't worry > about symbols and just type short names. > - In OTHER contexts, when you want to mix people and flowers in the > same list, it's easy to do without perturbing already chosen symbolic > data structures and without yielding confusion.
There are plenty of good examples like this, and I have learned to cope with the package system, but there are times when it does exactly the wrong thing. Suppose I have written two programs, 'wordhack' and 'letterhack'. I encapsulate them in packages as recommended, but as it happens I don't plan to use them together. 'wordhack' takes a file and returns a list of all the words that occur at least once in it, represented as symbols in the "WH" package. It's convenient to export the short words like 'a', 'the', etc. 'letterhack' takes a file and returns an alist of (letter integer) pairs giving the frequencies of letters: ((a 762) (qu 3) ...), where the symbols are interned in the "LH" package. I want to treat certain two-character sequences as letters, but I want to get EQness, so I use symbols. I export all the "letters."
Now several months later I write a third program that uses both packages, and I suddenly discover that there is a name conflict between 'wh:a' and 'lh:a'. I don't use the property list, value cell, or function cell of either symbol, so what I'd really like to say is, "Treat these as the same symbol; they will never occur in the same context, so there will never be any ambiguity about which is meant." Obviously, this example is contrived, but this sort of thing has happened to me more than once.
Another example is where package 1 defines a macro that uses various symbols as "local syntax" markers (such as 'for', 'in', when', etc. in '(loop for thing in things when (get thing 'color) collect thing))), and package 2 defines another macro that happens to use 'for' and 'collect' as local syntax markers. Now I write a program that uses both packages. There seems to be no reason in the world to have to write
(loop pkg1:for thing in things when (get thing 'color) pkg1:collect thing)
and
(wait pkg2:for (event e ...) then pkg2:collect e)
but that's what I have to do.
Of course, in both these cases I can decide to make package "PKG1" or package "LH" primary, and have "PKG2" and package "WH" import the conflicting symbols from their partner before re-exporting them, or set up a third package to play the role of dispenser of awkward symbols, but then this breaks all the applications that just want to use, say, 'wordhack' without 'letterhack.' (In the actual example above, 'for' and 'collect' happen to be in the "CL" package, so the problem, by happenstance, wouldn't arise; I just chose 'loop' so I could use a familiar macro.)
For these and other reasons, over the years my Common Lisp style has evolved away from being "symbol-dependent." Whenever possible, I make sure my macros use local syntax markers from the keyword package only. I always use tables instead of property lists. I often define variant symbol types that print something like symbols, and when appropriate read something like symbols, but differ from symbols in various ways (such as not being interned until after the first time they are printed).
However, symbols are a wonderful thing. Note that the whole reason symbols and packages come up as an issue in the Scheme-Lisp world, and not in the Haskell-ML world is that the language uses the same reader that user code uses. That makes macros possible, but it also raises all these complications about binding time. On balance I think I would prefer a module system to the package system, but it's not a strong preference.
And now apparently I have to tack on some verbiage about how I love "symbol-processing languages," and I despise Scheme (which, believe it or not, I do, pretty much), and I'm competent to talk about all this because I once coauthored a book on Lisp programming. Really, the tone on this newsgroup often sounds like a meeting of a Communist Party cell circa 1935, with the main item on the agenda being how to detect the Trotskyites among us.
g...@jpl.nasa.gov (Erann Gat) writes: > In article <sfwit7tsr3a....@shell01.TheWorld.com>, Kent M Pitman > <pit...@world.std.com> wrote:
> > A happy outcome for me in this would be an agreement to just refer to > > scheme symbols, at least in a language-neutral discussion, as > > "keywords" and not really as "symbols".
> I am happy to adopt this terminology. Ironically, I think this issue > arises because we are having a symbol clash in our natural language.
But then if I say "Keywords would make a nice extension to Scheme," referring to keyworded arguments, confusion would arise.
> Until recently I thought this was the dominant view in the CL community, > but I have recently discovered this is not so. Many people believe that > packages are a feature in and of themselves, that they provide some > benefit independent of any legacy considerations, that if they had it to > do over again they would still incorporate packages into the design. I am > now trying to understand that point of view.
That's exactly the question Kent answered in the post you're replying to. I'm trying to get him to answer a different question, and you're interfering. ;-)
It's all about identity. Not identity in the sense of eq, but in the sense of how objects are named, i.e. how the programmer identifies things. I'll speak of naming rather than identity to avoid the confusion about all objects having identity in the sense of eq.
Kent is pointing out that it's not a bug, but a feature that symbols are renamed by the package system. Merely renaming functions to be exported would not be enough.
The issues regarding naming are the same, whether it's a programmer naming a function, or a program naming some object with a symbol. Keeping the names straight in different contexts is what the package system does. A module system would only help keep the function names straight.
I thought Kent's answer was clear, but perhaps the 3-paragraph summary above will help.
I'm satisfied with Kent's answer as to why the CL package system is a good thing. However, what I want is an answer to a different question. I tried to ask this question in a previous post, but it wasn't clear, so I'll try again with some background.
Scheme does not have a module system. Different implementations have module systems as extensions, but there is no standard Scheme module system, and I think some implementations don't even have one.
When using programs from different sources, you rely on luck to avoid naming conflicts, or on uniqueness of prefixes chosen by the programmer (e.g. Dorai's pregexp), much as you do with C. However, nobody claims that C and R5RS Scheme are not examples of programming languages, even though there is a serious naming issue that affects programming.
However, now that Kent has discovered that there's a serious naming issue that affects symbolic processing, he's ready to conclude that Scheme is not an example of a symbolic processing language. Sure, you can do symbolic processing on a small scale, but start to integrate symbolic processing code from different sources and you'll hit naming conflicts.
Note that in the above paragraph, you could substitute any style of programming for "symbolic processing", the only difference being that the naming conflicts in question would be function names rather than symbol names. Shall we go on to say that Scheme is not an exemplar of *any* style of programming, at least until such time as it gets a standardized module system?
-- <brlewis@[(if (brl-related? message) ; Bruce R. Lewis "users.sourceforge.net" ; http://brl.sourceforge.net/ "alum.mit.edu")]>
>> In article <sfwit7tsr3a....@shell01.TheWorld.com>, Kent M Pitman >> <pit...@world.std.com> wrote:
>> > A happy outcome for me in this would be an agreement to just refer to >> > scheme symbols, at least in a language-neutral discussion, as >> > "keywords" and not really as "symbols".
>> I am happy to adopt this terminology. Ironically, I think this issue >> arises because we are having a symbol clash in our natural language.
>But then if I say "Keywords would make a nice extension to Scheme," >referring to keyworded arguments, confusion would arise.
I suggest that there is a technical, as opposed to mere naming-cultural, roadblock also. :keywords in Common Lisp are self-evaluating constants. Symbols (or whatever they must now be called) in Scheme still have the identifier role to play that symbols in general (not the ones that are keywords) do in CL. Scheme symbols are not (in general) self-evaluating, and CL keywords are useless as variable identifiers.
Each category can do something significant the other cannot. The "happy" identification of them that Kent is suggesting and Erann is agreeing to requires an amount of stretching that may not just be unhappy but impossible.