Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What's up with #'?

10 views
Skip to first unread message

Chris Gehlker

unread,
Nov 16, 2002, 11:58:52 AM11/16/02
to
Let me ask, with all due humility as a very newbie, if anyone else thinks #'
is a code smell? If it is a code smell, is it *supposed* to be in the sense
that C++ has things in it that stink by design?

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----

Christopher C. Stacy

unread,
Nov 16, 2002, 12:03:50 PM11/16/02
to
>>>>> On Sat, 16 Nov 2002 09:58:52 -0700, Chris Gehlker ("Chris") writes:
Chris> Let me ask, with all due humility as a very newbie, if anyone
Chris> else thinks #' is a code smell? If it is a code smell, is it
Chris> *supposed* to be in the sense that C++ has things in it that
Chris> stink by design?

#' is a built-in reader macro.
What is a "code smell"?

Kenny Tilton

unread,
Nov 16, 2002, 12:04:35 PM11/16/02
to


http://c2.com/cgi/wiki?CodeSmell

So I do not think it is a c/s, it's just an optional shorthand for (I
think) symbol-function.

--

kenny tilton
clinisys, inc
---------------------------------------------------------------
""Well, I've wrestled with reality for thirty-five years, Doctor,
and I'm happy to state I finally won out over it.""
Elwood P. Dowd

Henrik Motakef

unread,
Nov 16, 2002, 12:27:04 PM11/16/02
to
cst...@dtpq.com (Christopher C. Stacy) writes:

> >>>>> On Sat, 16 Nov 2002 09:58:52 -0700, Chris Gehlker ("Chris") writes:
>> Let me ask, with all due humility as a very newbie, if anyone

>> else thinks #' is a code smell? If it is a code smell, is it

>> *supposed* to be in the sense that C++ has things in it that

>> stink by design?
>
> #' is a built-in reader macro.
> What is a "code smell"?

"A code smell is a hint that something has gone wrong somewhere in
your code."
<http://c2.com/cgi/wiki?CodeSmell>

Kenny Tilton

unread,
Nov 16, 2002, 12:11:28 PM11/16/02
to

Chris Gehlker wrote:
> Let me ask, with all due humility as a very newbie, if anyone else thinks #'
> is a code smell? If it is a code smell, is it *supposed* to be in the sense
> that C++ has things in it that stink by design?

Do you mean #' indicates there is something wrong with CL? It's just
shorthand. What don't you like about it? I'll tell you what I do not
like: if i doubleclick #'this, my editor only selects this, not #'this.
but that is not enough to make me code this: (symbol-function 'this)

---

Henrik Motakef

unread,
Nov 16, 2002, 12:38:51 PM11/16/02
to
Kenny Tilton <kti...@nyc.rr.com> writes:

> So I do not think it is a c/s, it's just an optional shorthand for (I
> think) symbol-function.

function, actually. (Sidenote: Is it possible to look up such
Sharpsign macros with ILisps hyperspec-lookup?)

I don't smell anything either. What is wrong with that?

Regards
Henrik

Nils Goesche

unread,
Nov 16, 2002, 12:59:13 PM11/16/02
to
Chris Gehlker <geh...@fastq.com> writes:

> Let me ask, with all due humility as a very newbie, if anyone
> else thinks #' is a code smell? If it is a code smell, is it
> *supposed* to be in the sense that C++ has things in it that
> stink by design?

#' is needed because of a quite deliberate decision to use
different namespaces for functions and variables, not an
accident. Once you understand that you'll immediately see that
it doesn't ``stink´´ at all.

Regards,
--
Nils Gösche
Ask not for whom the <CONTROL-G> tolls.

PGP key ID #xD26EF2A0

Tim Bradshaw

unread,
Nov 16, 2002, 12:57:16 PM11/16/02
to
* Chris Gehlker wrote:
> Let me ask, with all due humility as a very newbie, if anyone else thinks #'
> is a code smell? If it is a code smell, is it *supposed* to be in the sense
> that C++ has things in it that stink by design?

No. It might be if you think that single-namespace Lisps are
inherently superior, but CL people don't think that.

--tim

Nils Goesche

unread,
Nov 16, 2002, 1:18:54 PM11/16/02
to
Kenny Tilton <kti...@nyc.rr.com> writes:

> Christopher C. Stacy wrote:
> >>>>>>On Sat, 16 Nov 2002 09:58:52 -0700, Chris Gehlker ("Chris") writes:
> >>>>>
> > Chris> Let me ask, with all due humility as a very newbie, if anyone
> > Chris> else thinks #' is a code smell? If it is a code smell, is it
> > Chris> *supposed* to be in the sense that C++ has things in it that
> > Chris> stink by design?
> > #' is a built-in reader macro.
> > What is a "code smell"?
>
>
> http://c2.com/cgi/wiki?CodeSmell
>
> So I do not think it is a c/s, it's just an optional shorthand for (I
> think) symbol-function.

No, it is an optional shorthand for FUNCTION:

CL-USER 23 > (defun blark (x)
(+ x 42))
BLARK

CL-USER 24 > (flet ((blark (x)
(+ x 2)))
(values (funcall (function blark) 40)
(funcall (symbol-function 'blark)
0)))
42
42

Erik Naggum

unread,
Nov 16, 2002, 1:36:18 PM11/16/02
to
* Chris Gehlker

| Let me ask, with all due humility as a very newbie, if anyone else thinks #'
| is a code smell? If it is a code smell, is it *supposed* to be in the sense
| that C++ has things in it that stink by design?

If you prefer to write (function foo) over #'foo, nobody will notice, as
the latter means exactly and only the former. If you prefer to write
(quote foo) over 'foo, however, many will notice, since ' is so common.

FYI: /real/ humility looks quite different.

--
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

unread,
Nov 16, 2002, 1:38:36 PM11/16/02
to
* Kenny Tilton

| Do you mean #' indicates there is something wrong with CL? It's just
| shorthand. What don't you like about it? I'll tell you what I do not
| like: if i doubleclick #'this, my editor only selects this, not #'this.
| but that is not enough to make me code this: (symbol-function 'this)

But would you write (function this), which it actually means?

I think hips that have just been shot from have a distinct smell.

Chris Gehlker

unread,
Nov 16, 2002, 2:01:19 PM11/16/02
to
On 11/16/02 10:59 AM, in article 87of8p7...@darkstar.cartan, "Nils
Goesche" <n...@cartan.de> wrote:

> Chris Gehlker <geh...@fastq.com> writes:
>
>> Let me ask, with all due humility as a very newbie, if anyone
>> else thinks #' is a code smell? If it is a code smell, is it
>> *supposed* to be in the sense that C++ has things in it that
>> stink by design?
>
> #' is needed because of a quite deliberate decision to use
> different namespaces for functions and variables, not an
> accident. Once you understand that you'll immediately see that

> it doesn't ``stink创 at all.
>
> Regards,


Thanks Nils and everyone else who responded. Given that functions are in a
separate namespace, #' does make sense. Now what still has a whiff about it,
for me is compile. Here's why:

[1]> (setq test 8)
8
[2]> test
8
[3]> (defun test (x)
(+ x 8))
TEST
[4]> test ; Really are separate namespaces
8
[5]> (test 3)
11
[6]> #'test
#<CLOSURE TEST (X) (DECLARE (SYSTEM::IN-DEFUN TEST))
(BLOCK TEST (+ X 8))> ;cool
[7]> (compiled-function-p #'test)
NIL
[8]> (compiled-function-p 'test)
NIL
[9]> (compiled-function-p test)
NIL
[10]> (compile #'test) ;; Huh!? Why didn't this work?

*** - Name of function to be compiled must be a symbol, not #<CLOSURE TEST
(X) (DECLARE (SYSTEM::IN-DEFUN TEST)) (BLOCK TEST (+ X 8))>

1. Break [11]> (compile 'test) ; And why *did* this work? 'test is just 4
letters

TEST ;
NIL ;
NIL
1. Break [11]> (compiled-function-p #'test)
T

So, is compile the only function that "works" this way?

Kenny Tilton

unread,
Nov 16, 2002, 2:21:14 PM11/16/02
to

Nils Goesche wrote:


> Kenny Tilton <kti...@nyc.rr.com> writes:
>
>
>>So I do not think it is a c/s, it's just an optional shorthand for (I
>>think) symbol-function.
>
>
> No, it is an optional shorthand for FUNCTION:
>
> CL-USER 23 > (defun blark (x)
> (+ x 42))
> BLARK
>
> CL-USER 24 > (flet ((blark (x)
> (+ x 2)))
> (values (funcall (function blark) 40)
> (funcall (symbol-function 'blark)
> 0)))
> 42
> 42
>
> Regards,

Yeah, i always get that wrong. But this nice, succinct example finally
will get me over the hump, I think. Thanks.

Chris Gehlker

unread,
Nov 16, 2002, 2:26:57 PM11/16/02
to
On 11/16/02 11:36 AM, in article 32464605...@naggum.no, "Erik Naggum"
<er...@naggum.no> wrote:

> FYI: /real/ humility looks quite different.

Believe me, the humility is very genuine. I know that I *don't know* this
stuff. I also know that CltL2 is supposed to be online but it was hosed when
I tried to look this up.

Christopher C. Stacy

unread,
Nov 16, 2002, 2:30:08 PM11/16/02
to
COMPILE takes as its argument the name of a function.
COMPILE does not take a function object.

FUNCTION takes as its argument the name of a function,
and returns the function object.

Nils Goesche

unread,
Nov 16, 2002, 2:33:44 PM11/16/02
to
Chris Gehlker <geh...@fastq.com> writes:

> Now what still has a whiff about it, for me is compile. Here's
> why:
>

> [6]> #'test
> #<CLOSURE TEST (X) (DECLARE (SYSTEM::IN-DEFUN TEST))
> (BLOCK TEST (+ X 8))> ;cool
> [7]> (compiled-function-p #'test)
> NIL
> [8]> (compiled-function-p 'test)
> NIL
> [9]> (compiled-function-p test)
> NIL
> [10]> (compile #'test) ;; Huh!? Why didn't this work?
>
> *** - Name of function to be compiled must be a symbol, not
> #<CLOSURE TEST (X) (DECLARE (SYSTEM::IN-DEFUN TEST)) (BLOCK
> TEST (+ X 8))>
>
> 1. Break [11]> (compile 'test) ; And why *did* this work? 'test
> is just 4 letters

No, TEST is a symbol. Whenever you have a question like this you
can easily find the answer by looking it up in the HyperSpec. In
this case:

http://www.lispworks.com/reference/HyperSpec/Body/f_cmp.htm

Look what COMPILE expects as argument. Same with
COMPILED-FUNCTION-P, which is described at

http://www.lispworks.com/reference/HyperSpec/Body/f_cmpd_f.htm

> So, is compile the only function that "works" this way?

I am not sure what you mean.

Oleg

unread,
Nov 16, 2002, 2:35:23 PM11/16/02
to
Chris Gehlker wrote:

Do (inspect 'test) do get an idea of what Lisp creators meant by all this.

So 'test is a symbol that has a value (binding) as a regular value (sic),
and a value as a function:

'test - neither 8, nor your function
test - value 8
#'test - the function you defined

I agree with you that it's a bit confusing, and I suspect that the reason
for all this confusion is that people who created Lisp entertained ideas
that one day people would write programs in Lisp that would write even
smarter programs in Lisp that would write even smarter programs in Lisp ...
That's why they went into all this trouble ;-)

Oleg

Erik Naggum

unread,
Nov 16, 2002, 2:40:00 PM11/16/02
to
* Chris Gehlker

| Believe me, the humility is very genuine. I know that I *don't know*
| this stuff. I also know that CltL2 is supposed to be online but it was
| hosed when I tried to look this up.

The part of the article you ignored explained it. How come you still do
not know? What is more important to you, to prove that your humility is
real or to learn something? I think everybody else cares more about the
latter than the former.

Kenny Tilton

unread,
Nov 16, 2002, 2:51:38 PM11/16/02
to

Chris Gehlker wrote:
> On 11/16/02 11:36 AM, in article 32464605...@naggum.no, "Erik Naggum"
> <er...@naggum.no> wrote:
>
>
>>FYI: /real/ humility looks quite different.
>
>
> Believe me, the humility is very genuine.

I thought your question and followups were fine.

there /is/ a dissonance between "humility" and the "this smells"
conclusion implicit in "does anyone else think...", but I do the same
thing (if, that is, my guess at your intent is accurate): put my
questions in the form of judgmental statements (because it is more fun
to use strong words), with a blanket disclaimer that I don't know what I
am talking about hence am open to and eager for correction.

Chris Gehlker

unread,
Nov 16, 2002, 3:08:14 PM11/16/02
to
On 11/16/02 12:33 PM, in article 871y5l7...@darkstar.cartan, "Nils
Goesche" <n...@cartan.de> wrote:

I wrote the >> stuff.

>> 1. Break [11]> (compile 'test) ; And why *did* this work? 'test
>> is just 4 letters
>
> No, TEST is a symbol.

Help. Don't you mean "'TEST" is a symbol? What do you call "TEST"?

> Whenever you have a question like this you
> can easily find the answer by looking it up in the HyperSpec. In
> this case:
>
> http://www.lispworks.com/reference/HyperSpec/Body/f_cmp.htm

This is great! Thanks.


>
> Look what COMPILE expects as argument. Same with
> COMPILED-FUNCTION-P, which is described at
>
> http://www.lispworks.com/reference/HyperSpec/Body/f_cmpd_f.htm
>
>> So, is compile the only function that "works" this way?
>
> I am not sure what you mean.

Now that you've shown me this great reference, I can formulate the question
in a more meaningful way. I can see by the hyperspeck that the argument to
COMPILE is a function name and the argument to COMPILED-FUNCTION-P is an
object. I assume that there is some underlying rationale for choosing the
argument types for functions and that an experienced Lisp programmer will
know, or at least be able to guess most of the time, what argument is
appropriate for any given function. How does one develop such intuition?

Kenny Tilton

unread,
Nov 16, 2002, 3:24:08 PM11/16/02
to

Chris Gehlker wrote:
> On 11/16/02 12:33 PM, in article 871y5l7...@darkstar.cartan, "Nils
> Goesche" <n...@cartan.de> wrote:
>
> I wrote the >> stuff.
>
>
>>>1. Break [11]> (compile 'test) ; And why *did* this work? 'test
>>>is just 4 letters
>>
>>No, TEST is a symbol.
>
>
> Help. Don't you mean "'TEST" is a symbol? What do you call "TEST"?

That's a string. You /really/ need to slow down a little. :) In Lisp we
usually work with symbols (and they're great).

> Now that you've shown me this great reference, I can formulate the question
> in a more meaningful way. I can see by the hyperspeck that the argument to
> COMPILE is a function name and the argument to COMPILED-FUNCTION-P is an
> object. I assume that there is some underlying rationale for choosing the
> argument types for functions and that an experienced Lisp programmer will
> know, or at least be able to guess most of the time, what argument is
> appropriate for any given function. How does one develop such intuition?

I wouldn't worry about it until I knew the language better, the issue
might just go away for you. Bu it is a problem sometimes. make-instance
will accept the name of a class or the class itself:

(make-instance 'my-class) or (make-instance (find-class 'my-class))

That's just being friendly. But many other functions taking a class as
an argument won't let you slide with just the symbolic name, you have
to: (class-whatever (find-class 'my-class)). Those functions are more
internal-y, so you usually do have the class instance itself at hand, so
no one bothered to toss in a friendly alternative.

Chris Gehlker

unread,
Nov 16, 2002, 3:38:38 PM11/16/02
to
On 11/16/02 12:51 PM, in article 3DD6A2A0...@nyc.rr.com, "Kenny Tilton"
<kti...@nyc.rr.com> wrote:

>
>
> Chris Gehlker wrote:
>> On 11/16/02 11:36 AM, in article 32464605...@naggum.no, "Erik Naggum"
>> <er...@naggum.no> wrote:
>>
>>
>>> FYI: /real/ humility looks quite different.
>>
>>
>> Believe me, the humility is very genuine.
>
> I thought your question and followups were fine.

Thanks!


>
> there /is/ a dissonance between "humility" and the "this smells"
> conclusion implicit in "does anyone else think...", but I do the same
> thing (if, that is, my guess at your intent is accurate): put my
> questions in the form of judgmental statements (because it is more fun
> to use strong words), with a blanket disclaimer that I don't know what I
> am talking about hence am open to and eager for correction.

I do like to use strong statements with a invitation to others to correct
them. For me it's faster to test my tentative understanding on the community
than to just ask questions.

But I also just made a bad assumption. On comp.lang.ruby to say that
something "smells" just means that it confuses you. I should have said "Does
anyone else find this confusing?"

To say that something is "surprising", on the other hand, means that it
sucks, as in "Java is full of surprises." My God, I just insulted the
Javaphiles here.

Different list, different culture. I should have anticipated that.

Thanks again for the kind words.

Nils Goesche

unread,
Nov 16, 2002, 3:41:04 PM11/16/02
to
Chris Gehlker <geh...@fastq.com> writes:

> On 11/16/02 12:33 PM, in article 871y5l7...@darkstar.cartan, "Nils
> Goesche" <n...@cartan.de> wrote:
>
> I wrote the >> stuff.
>
> >> 1. Break [11]> (compile 'test) ; And why *did* this work? 'test
> >> is just 4 letters
> >
> > No, TEST is a symbol.
>
> Help. Don't you mean "'TEST" is a symbol? What do you call
> "TEST"?

"TEST" would be a string :-) I am calling the symbol by its
name, as it is printed:

CL-USER 28 > (print 'test)

TEST
TEST

Lisp's builtin parser, the so-called `reader´, also recognizes it
by that name:

CL-USER 31 > (read-from-string "TEST")
TEST
4

CL-USER 32 > (format t "~&Got ~S" (read))
TEST ; <- I typed this in at the terminal
Got TEST
NIL

Now look what it gets if you pass it 'test instead:

CL-USER 33 > (format t "~&Got ~S" (read))
'test
Got (QUOTE TEST)
NIL

' is actually a read macro -- it transforms ``'test´´ into
(QUOTE TEST) already while parsing (``at read time´´). You only
have to quote TEST if you want to prevent it from being
evaluated. (foo test) will evaluate TEST and look for the value
of the variable named by TEST. If you don't want that you quote
it as in (foo (quote test)). (foo 'test) is just a handy
abbreviation for this. We also have

CL-USER 34 > (symbol-name 'test)
"TEST"

which returns TEST's name as a string.

You can also download the whole thing at

http://www.lispworks.com/reference/HyperSpec/

> >> So, is compile the only function that "works" this way?
> >
> > I am not sure what you mean.
>
> Now that you've shown me this great reference, I can formulate
> the question in a more meaningful way. I can see by the
> hyperspeck that the argument to COMPILE is a function name and
> the argument to COMPILED-FUNCTION-P is an object. I assume that
> there is some underlying rationale for choosing the argument
> types for functions and that an experienced Lisp programmer
> will know, or at least be able to guess most of the time, what
> argument is appropriate for any given function. How does one
> develop such intuition?

I don't know; I think it is quite intuitive as it is. Stuff like
COMPILED-FUNCTION-P, like, say, CONSP or SYMBOLP all get an
arbitrary object (and check its type). If COMPILE accepted an
arbitrary function, it would have to be able to retrieve its
definition somehow just from the function itself; that would be
somewhat strange; so it gets the /name/ of a function instead.

Chris Gehlker

unread,
Nov 16, 2002, 3:54:05 PM11/16/02
to
On 11/16/02 12:35 PM, in article ar66m4$fkf$1...@newsmaster.cc.columbia.edu,
"Oleg" <oleg_i...@myrealbox.com> wrote:

> Do (inspect 'test) do get an idea of what Lisp creators meant by all this.

That's way cool! I even understood most of the output, dimly, except for the
array reference at the end.


>
> So 'test is a symbol that has a value (binding) as a regular value (sic),
> and a value as a function:
>
> 'test - neither 8, nor your function
> test - value 8
> #'test - the function you defined
>
> I agree with you that it's a bit confusing, and I suspect that the reason
> for all this confusion is that people who created Lisp entertained ideas
> that one day people would write programs in Lisp that would write even
> smarter programs in Lisp that would write even smarter programs in Lisp ...
> That's why they went into all this trouble ;-)

I believe you. However it already seems to me that one of the best kept
secrets about Lisp is that it's just kick-ass fun. I expected a lot of
things but not that.

Erik Naggum

unread,
Nov 16, 2002, 4:02:36 PM11/16/02
to
* Chris Gehlker

| I do like to use strong statements with a invitation to others to correct
| them.

Then just do it, do not defend yourself when others do not like it. Stick
to the point. People who stick to the point learn a lot here, and fast.

You should perhaps realize that humility and strong statements are not
typically regarded as internally consistent. That you chose to respond
/only/ to the rejection of your purported humility also suggests otherwise.

| But I also just made a bad assumption. On comp.lang.ruby to say that
| something "smells" just means that it confuses you.

Thanks for the information. I doubt that I shall find occasion to use it.

Henrik Motakef

unread,
Nov 16, 2002, 4:27:55 PM11/16/02
to
Chris Gehlker <geh...@fastq.com> writes:

> On 11/16/02 12:35 PM, in article ar66m4$fkf$1...@newsmaster.cc.columbia.edu,
> "Oleg" <oleg_i...@myrealbox.com> wrote:
>
>> Do (inspect 'test) do get an idea of what Lisp creators meant by all this.
>
> That's way cool! I even understood most of the output, dimly, except for the
> array reference at the end.

If you like this, you might also want to try DESCRIBE, DOCUMENTATION
and APROPOS.

> I believe you. However it already seems to me that one of the best kept
> secrets about Lisp is that it's just kick-ass fun. I expected a lot of
> things but not that.

:-) So true...

Regards
Henrik

Erik Naggum

unread,
Nov 16, 2002, 4:17:03 PM11/16/02
to
* Chris Gehlker

| How does one develop such intuition?

By actually being humble and showing real humility before the great task
of learning, which in practice means a higher affinity for listening than
for pronouncing opinions. Ask questions to learn something specific and
be open to surprises and all kinds of answers. Stay focused on learning.
The stronger you feel a need to make pronouncements, the longer it takes.
The more you are willing to accept that other people know more about it
than you do, the shorter it generally takes to learn it. You did well to
notice that we do not use "smell" in this newsgroup and backed off, which
tells me that you easily accept corrections to your assumptions, it just
needs to be applied a little more widely. As long as you want to learn
and make comments that exhibit your willingness to respect the very long
history of the language and see ways to solve your problems rather than
ways to create problems. This actually applies to all programming, but
for some reason, programming attracts people who have strong opinions on
just about everything. The key is to make them have strong opinions on
things that matter, which is sometimes hard when they are busy having
strong opinions on things that do not matter.

Chris Gehlker

unread,
Nov 16, 2002, 4:18:58 PM11/16/02
to
On 11/16/02 1:24 PM, in article 3DD6AA3...@nyc.rr.com, "Kenny Tilton"
<kti...@nyc.rr.com> wrote:

>
> That's a string. You /really/ need to slow down a little. :)

Point taken.


>In Lisp we
> usually work with symbols (and they're great).
>
>> Now that you've shown me this great reference, I can formulate the question
>> in a more meaningful way. I can see by the hyperspeck that the argument to
>> COMPILE is a function name and the argument to COMPILED-FUNCTION-P is an
>> object. I assume that there is some underlying rationale for choosing the
>> argument types for functions and that an experienced Lisp programmer will
>> know, or at least be able to guess most of the time, what argument is
>> appropriate for any given function. How does one develop such intuition?
>
> I wouldn't worry about it until I knew the language better, the issue
> might just go away for you. Bu it is a problem sometimes. make-instance
> will accept the name of a class or the class itself:
>
> (make-instance 'my-class) or (make-instance (find-class 'my-class))
>
> That's just being friendly. But many other functions taking a class as
> an argument won't let you slide with just the symbolic name, you have
> to: (class-whatever (find-class 'my-class)). Those functions are more
> internal-y, so you usually do have the class instance itself at hand, so
> no one bothered to toss in a friendly alternative.
>

I will try to be patient. A kind fellow suggested that the way to learn this
language was to read "On Lisp" by Paul Graham. It does provide a good
overview but he glosses over some points or presents them without
motivation. It's as if he expected that this would be everyone's *second*
Lisp book. So I get frustrated at my lack of understanding and run here for
help. Everyone gives it too, which is great.

Nils Goesche

unread,
Nov 16, 2002, 4:24:59 PM11/16/02
to
Chris Gehlker <geh...@fastq.com> writes:

> I will try to be patient. A kind fellow suggested that the way
> to learn this language was to read "On Lisp" by Paul Graham. It
> does provide a good overview but he glosses over some points or
> presents them without motivation. It's as if he expected that
> this would be everyone's *second* Lisp book.

Well, it's subtitled ``Advanced techniques for Common Lisp´´ for
a reason :-) He also wrote a ``first´´ book:

http://makeashorterlink.com/?U2D012972

> So I get frustrated at my lack of understanding and run here
> for help.

Just be patient. Nobody got it all at once.

Kenny Tilton

unread,
Nov 16, 2002, 4:56:30 PM11/16/02
to

Chris Gehlker wrote:
> It's as if he expected that this would be everyone's *second*
> Lisp book.

Oh yeah. I googled "lisp tutorial", found this:

http://grimpeur.tamu.edu/~colin/lp/

Don't know if it's any good, tho. there's also http://www.alu.org as a
jumping-off point for other resources.

And if you are near New York City, drop by the first meeting of ILUG-NY
next week.

Kenny Tilton

unread,
Nov 16, 2002, 5:03:17 PM11/16/02
to

Chris Gehlker wrote:
> I believe you. However it already seems to me that one of the best kept
> secrets about Lisp is that it's just kick-ass fun. I expected a lot of
> things but not that.

Years ago after I bought MCLs for my little team seated in separate
areas, we spent the first week taking turns running into each others'
space yelling "Have you seen this?!!" and then typing some form into
each others' listeners. Heady days I'll never forget.

Then I did grab On Lisp (just out I think). The preface was
the best part, since I knew anyway i would be creating
my own embedded language, and he goes into that

Marc Spitzer

unread,
Nov 16, 2002, 5:28:57 PM11/16/02
to
Chris Gehlker <geh...@fastq.com> writes:
>
> I do like to use strong statements with a invitation to others to correct
> them. For me it's faster to test my tentative understanding on the community
> than to just ask questions.

Don't take this the wrong way, but when you do this you /apear/ to be
an arogant ass. Please note I did not say you were one, just that you
looked like one. Also if you are unwilling to do the work nessary to
have a real understanding why should people continue to help you get
there? Remember it may be faster for you is not the main issue. What
is the main issue is "is this worth going to the well for a bucket of
help?". By going to the well too often it may dry up or people might
decide that their time would be better spent with you somewhere else
and encourage you to leave.

>
> But I also just made a bad assumption. On comp.lang.ruby to say that
> something "smells" just means that it confuses you. I should have said "Does
> anyone else find this confusing?"
>

Well I see something smells, I think "like 2 day old fish in the
summer sun" or ripe garbage.

marc

Daniel Barlow

unread,
Nov 16, 2002, 6:10:51 PM11/16/02
to
Henrik Motakef <henrik....@web.de> writes:

> Chris Gehlker <geh...@fastq.com> writes:
>> That's way cool! I even understood most of the output, dimly, except for the
>> array reference at the end.
>
> If you like this, you might also want to try DESCRIBE, DOCUMENTATION
> and APROPOS.

And DISASSEMBLE

Unless you're called Johnny 5, anyway


-dan

--

http://ww.telent.net/cliki/ - Link farm for free CL-on-Unix resources

Kenny Tilton

unread,
Nov 16, 2002, 7:15:58 PM11/16/02
to

Marc Spitzer wrote:
> Don't take this the wrong way, but when you do this you /apear/ to be
> an arogant ass. Please note I did not say you were one, just that you
> looked like one.

Distinction without a difference? I'll try "you only look like an ass"
on the first bouncer I see headed up Broadway tonight. Wish me luck. :)

> What
> is the main issue is "is this worth going to the well for a bucket of
> help?".

Right. Early on with a new language, when I know my questions are dumb,
I feel free to toss a question out on an NG, knowing that the folks will
likely be able to answer effortlessly (or they will say, whoa, slow
down, get a book). I am not asking for a bucket, just a drop.

To me, taking specific questions to the experts on an NG /is/ a
respectable form of research, and it is no imposition because (a) again,
the questions are no-brainers and (b) hey, only the folks that want to
answer do so.

Kenny Tilton

unread,
Nov 16, 2002, 8:02:56 PM11/16/02
to

Erik Naggum wrote:
> * Kenny Tilton
> | Do you mean #' indicates there is something wrong with CL? It's just
> | shorthand. What don't you like about it? I'll tell you what I do not
> | like: if i doubleclick #'this, my editor only selects this, not #'this.
> | but that is not enough to make me code this: (symbol-function 'this)
>
> But would you write (function this), which it actually means?
>
> I think hips that have just been shot from have a distinct smell.
>

Your aim is wide. I gave that mistake careful thought and consulted the
hyperpsec for both function and symbol-function before posting.

Of course you did not know that when you characterized my effort, so if
that smell over there is not from the cll newbies buried under your
floorboards, you might want to check your smoking hips.

--

kenny tilton
clinisys, inc
---------------------------------------------------------------

Good manners sometimes means simply putting up with other people's bad
manners. -- H. Jackson Browne

Thomas F. Burdick

unread,
Nov 16, 2002, 8:43:20 PM11/16/02
to
Kenny Tilton <kti...@nyc.rr.com> writes:

> Nils Goesche wrote:
> > Kenny Tilton <kti...@nyc.rr.com> writes:
> >
> >
> >>So I do not think it is a c/s, it's just an optional shorthand for (I
> >>think) symbol-function.
> >
> >
> > No, it is an optional shorthand for FUNCTION:
> >
> > CL-USER 23 > (defun blark (x)
> > (+ x 42))
> > BLARK
> >
> > CL-USER 24 > (flet ((blark (x)
> > (+ x 2)))
> > (values (funcall (function blark) 40)
> > (funcall (symbol-function 'blark)
> > 0)))
> > 42
> > 42
> >
> > Regards,
>
> Yeah, i always get that wrong. But this nice, succinct example finally
> will get me over the hump, I think. Thanks.

Heh, I'd think an even more succinct example would be:

* #'(lambda () nil)
#<Interpreted Function (LAMBDA () NIL) {80083F41}>
* (symbol-function '(lambda () nil))

Type-error in KERNEL::OBJECT-NOT-SYMBOL-ERROR-HANDLER:
(LAMBDA () NIL) is not of type SYMBOL

Restarts:
0: [ABORT] Return to Top-Level.

Debug (type H for help)

(SYMBOL-FUNCTION 1 (LAMBDA () NIL))[:EXTERNAL]
0]

--
/|_ .-----------------------.
,' .\ / | No to Imperialist war |
,--' _,' | Wage class war! |
/ / `-----------------------'
( -. |
| ) |
(`-. '--.)
`. )----'

Thomas F. Burdick

unread,
Nov 16, 2002, 8:56:08 PM11/16/02
to
Chris Gehlker <geh...@fastq.com> writes:

> I will try to be patient. A kind fellow suggested that the way to learn this
> language was to read "On Lisp" by Paul Graham. It does provide a good
> overview but he glosses over some points or presents them without
> motivation. It's as if he expected that this would be everyone's *second*
> Lisp book. So I get frustrated at my lack of understanding and run here for
> help. Everyone gives it too, which is great.

I think it's best for people coming to CL from Scheme, but it's a
pretty good Lisp book generally. However, if you'd read the preface,
you'd see that it *is* intended as a second book :)

Thomas Stegen

unread,
Nov 16, 2002, 8:57:16 PM11/16/02
to
Kenny Tilton wrote:

> Your aim is wide. I gave that mistake careful thought and consulted the
> hyperpsec for both function and symbol-function before posting.

Why didn't you just look up #' ? Took about 5 seconds to find...

--
Thomas.

Duane Rettig

unread,
Nov 16, 2002, 9:00:01 PM11/16/02
to
Nils Goesche <n...@cartan.de> writes:

> If COMPILE accepted an
> arbitrary function, it would have to be able to retrieve its
> definition somehow just from the function itself; that would be
> somewhat strange; so it gets the /name/ of a function instead.

Huh? Sending a function object to compile is perfectly acceptable
(and intuitive, to me):

CL-USER(1): (defun test (x)
(+ x 8))
TEST
CL-USER(2): (test 10)
18
CL-USER(3): (compiled-function-p #'test)
NIL
CL-USER(4): (compile nil #'test)
#<Function (:ANONYMOUS-LAMBDA 0) @ #x716180fa>
NIL
NIL
CL-USER(5): (funcall * 10)
18
CL-USER(6): (compiled-function-p **)
T
CL-USER(7): (compiled-function-p #'test)
NIL
CL-USER(8):

--
Duane Rettig du...@franz.com Franz Inc. http://www.franz.com/
555 12th St., Suite 1450 http://www.555citycenter.com/
Oakland, Ca. 94607 Phone: (510) 452-2000; Fax: (510) 452-0182

Erik Naggum

unread,
Nov 16, 2002, 9:05:45 PM11/16/02
to
* Kenny Tilton

| Your aim is wide. I gave that mistake careful thought and consulted the
| hyperpsec for both function and symbol-function before posting.

That #'foo means (function foo) is written in plain text in the standard.
See 2.4.8.2 Sharpsign Single-Quote.

| Of course you did not know that when you characterized my effort, so if
| that smell over there is not from the cll newbies buried under your
| floorboards, you might want to check your smoking hips.

What is your major malfunction, numbnut?

Marc Spitzer

unread,
Nov 16, 2002, 9:27:32 PM11/16/02
to
Kenny Tilton <kti...@nyc.rr.com> writes:

> Marc Spitzer wrote:
> > Don't take this the wrong way, but when you do this you /apear/ to be
> > an arogant ass. Please note I did not say you were one, just that you
> > looked like one.
>
> Distinction without a difference? I'll try "you only look like an ass"
> on the first bouncer I see headed up Broadway tonight. Wish me luck. :)

That is remarkably insulting to everyone. You are saying that the
people here are as smart as your average NYC bouncer, particularly
Chris Gehlker.

>
>
> > What
> > is the main issue is "is this worth going to the well for a bucket of
> > help?".
>
> Right. Early on with a new language, when I know my questions are
> dumb, I feel free to toss a question out on an NG, knowing that the
> folks will likely be able to answer effortlessly (or they will say,
> whoa, slow down, get a book). I am not asking for a bucket, just a
> drop.
>

In a previous post, not on google yet, his method was to get some
vague idea and ask if it is right. This is not a good way to act if
you want help from many of the experts here, over the long haul.


>
> To me, taking specific questions to the experts on an NG /is/ a
> respectable form of research, and it is no imposition because (a)
> again, the questions are no-brainers and (b) hey, only the folks that
> want to answer do so.

Searching for your simple and easy question in google is good, not
trying to find the answer yourself and just asking a question you could
probably answer your self is bad. And people who want to help may
change their minds if they are bothered too much or get the feeling
that the asker is not doing any real work.

marc

Chris Gehlker

unread,
Nov 16, 2002, 9:41:08 PM11/16/02
to
On 11/16/02 2:24 PM, in article 87k7jd5...@darkstar.cartan, "Nils
Goesche" <n...@cartan.de> wrote:

> Well, it's subtitled ``Advanced techniques for Common Lisp创 for
> a reason :-) He also wrote a ``first创 book:
>
> http://makeashorterlink.com/?U2D012972

Great. I ordered it.


>
>> So I get frustrated at my lack of understanding and run here
>> for help.
>
> Just be patient. Nobody got it all at once.

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----

Chris Gehlker

unread,
Nov 16, 2002, 10:00:50 PM11/16/02
to
On 11/16/02 2:27 PM, in article 87ptt5b...@pokey.henrik-motakef.de,
"Henrik Motakef" <henrik....@web.de> wrote:

> Chris Gehlker <geh...@fastq.com> writes:
>
>> On 11/16/02 12:35 PM, in article ar66m4$fkf$1...@newsmaster.cc.columbia.edu,
>> "Oleg" <oleg_i...@myrealbox.com> wrote:
>>
>>> Do (inspect 'test) do get an idea of what Lisp creators meant by all this.
>>
>> That's way cool! I even understood most of the output, dimly, except for the
>> array reference at the end.
>
> If you like this, you might also want to try DESCRIBE, DOCUMENTATION
> and APROPOS.

These are so useful that I wonder why the little file called "Lisp-Tutorial"
that comes with CLISP didn't mention them. I'll post a note on the CLISP
site suggesting an addition to the file.

Chris Gehlker

unread,
Nov 16, 2002, 10:07:35 PM11/16/02
to
On 11/16/02 2:56 PM, in article 3DD6BFE4...@nyc.rr.com, "Kenny Tilton"
<kti...@nyc.rr.com> wrote:

>
>
> Chris Gehlker wrote:
>> It's as if he expected that this would be everyone's *second*
>> Lisp book.
>
> Oh yeah. I googled "lisp tutorial", found this:
>
> http://grimpeur.tamu.edu/~colin/lp/

I did work through that one before attempting the Graham book. I found it
very helpful as far as it went. From internal evidence though, I think the
authors either intended to add more or are adding more as time permits.

It did give me a real sense of how much fun CL is so I would recommend it to
other newbies. It just stopped before I really learned enough to attempt a
serious program.

Chris Gehlker

unread,
Nov 16, 2002, 10:21:29 PM11/16/02
to
On 11/16/02 3:28 PM, in article 86fzu18...@bogomips.optonline.net, "Marc
Spitzer" <mspi...@optonline.net> wrote:

>>
>> But I also just made a bad assumption. On comp.lang.ruby to say that
>> something "smells" just means that it confuses you. I should have said "Does
>> anyone else find this confusing?"
>>
>
> Well I see something smells, I think "like 2 day old fish in the
> summer sun" or ripe garbage.

Ah. It's supposed to be an analogy to the way your sense of smell conveys
information that's hard to articulate and sort of seeps in at an unconscious
level. I just read in Graham about being able to tell whether a building is
made of wood or stone by its general shape when you are too far away to
actually see the construction material. It's that same idea.

Nils Goesche

unread,
Nov 16, 2002, 10:22:38 PM11/16/02
to
Duane Rettig <du...@franz.com> writes:

> Nils Goesche <n...@cartan.de> writes:
>
> > If COMPILE accepted an arbitrary function, it would have to
> > be able to retrieve its definition somehow just from the
> > function itself; that would be somewhat strange; so it gets
> > the /name/ of a function instead.
>
> Huh? Sending a function object to compile is perfectly acceptable
> (and intuitive, to me):

> CL-USER(4): (compile nil #'test)

Ok. Call my ``intuition´´ old-fashioned, then ;-)

Nils Goesche

unread,
Nov 16, 2002, 10:39:35 PM11/16/02
to
Chris Gehlker <geh...@fastq.com> writes:

> On 11/16/02 2:24 PM, in article 87k7jd5...@darkstar.cartan, "Nils
> Goesche" <n...@cartan.de> wrote:
>

> > Well, it's subtitled ``Advanced techniques for Common Lisp´´
> > for a reason :-) He also wrote a ``first´´ book:


> >
> > http://makeashorterlink.com/?U2D012972
>
> Great. I ordered it.

Oops, I only mentioned that for completeness, not as a
recommendation. But the book certainly isn't bad. It was /my/
first Lisp book, BTW (apart from a book on Emacs Lisp). If you,
like me, don't mind simply buying a whole lot of books at once,
you should also get Stephen Slade's

http://www.amazon.com/exec/obidos/tg/detail/-/0136059406/qid=1037503675/sr=1-3/ref=sr_1_3/002-1754982-1253644?v=glance&s=books

Despite its strange title, it is just an ordinary introduction to
Common Lisp. People have called it boring here before, myself
included; however I think now that this is not fair: Its /prose/,
for one thing, isn't boring at all -- it is very entertaining
(and its quotations are real jewels). Check out ``1.2 The
Religion of Lisp´´ and you'll immediately better understand the
behavior of many people in this newsgroup (yours truly included).
Only its confusing title creates a wrong expectation among people
who already know Lisp -- they look for things they don't know
already and are disappointed if what they find is just -- an
introduction to Common Lisp. That doesn't mean, however, that it
must be a boring introduction for beginners. I like the way he
explains everything with lots of examples at the top-level.
Maybe you'll like it, too.

Chris Gehlker

unread,
Nov 17, 2002, 12:05:46 AM11/17/02
to
On 11/16/02 8:39 PM, in article 873cq06...@darkstar.cartan, "Nils
Goesche" <n...@cartan.de> wrote:

> Chris Gehlker <geh...@fastq.com> writes:
>
>> On 11/16/02 2:24 PM, in article 87k7jd5...@darkstar.cartan, "Nils
>> Goesche" <n...@cartan.de> wrote:
>>

>>> Well, it's subtitled ``Advanced techniques for Common Lisp创
>>> for a reason :-) He also wrote a ``first创 book:


>>>
>>> http://makeashorterlink.com/?U2D012972
>>
>> Great. I ordered it.
>
> Oops, I only mentioned that for completeness, not as a
> recommendation.

It's good to have some kind or recommendation. Besides, the reviews were
very positive and my wife was turning in an order anyway. The tutorial file
that comes with CLISP only mentions CLtL2 but that seems to be a reference
rather than an introduction. I mentioned before that the site is down but it
turns out the French mirror is up. It really does look like a reference, not
a tutorial.


> But the book certainly isn't bad. It was /my/
> first Lisp book, BTW (apart from a book on Emacs Lisp). If you,
> like me, don't mind simply buying a whole lot of books at once,
> you should also get Stephen Slade's
>
> http://www.amazon.com/exec/obidos/tg/detail/-/0136059406/qid=1037503675/sr=1-3
> /ref=sr_1_3/002-1754982-1253644?v=glance&s=books

I was able to add that to the order since it hadn't shipped yet.

Thanks again.

Gareth McCaughan

unread,
Nov 16, 2002, 11:53:41 PM11/16/02
to
Chris Gehlker wrote:

> Thanks Nils and everyone else who responded. Given that functions are in a
> separate namespace, #' does make sense. Now what still has a whiff about it,
> for me is compile. Here's why:
[SNIP: COMPILE gets passed the name of a function, not the function object]

There are two different things you might want COMPILE to do.

1. Accept a function and return a compiled version of it.
2. Make a particular symbol name a compiled version of whatever
it currently names.

If COMPILE wanted just a function object and not a name,
#1 would work fine but #2 wouldn't. (You need to give it
the name somehow.)

If COMPILE were defined as a macro -- like, say, INCF --
so that you didn't have to notice that you were feeding it
a name, then #2 would work quite nicely: you'd say (COMPILE FOO),
like you say (INCF X) or (TRACE FOO). But #1 wouldn't work.

To get the best of both worlds, the designers of CL made
it work like this. COMPILE takes *two* arguments: a name
and a function object. It compiles the function object,
and associates it with the name. But (1) if the name is
NIL then it doesn't do the "associates it with the name"
bit, and (2) the function object is an optional argument,
and if you omit it then the name's current function value
is used instead.

Thus, you say (COMPILE NIL (LAMBDA .....)) to make a new
compiled function. (Note: normally you don't need to do this.)
And you say (COMPILE FOO) to make sure that FOO names a
compiled function.

Now, the fact that almost all uses of COMPILE fall into
two categories, each of which declines to use one of
COMPILE's two arguments, is itself a (very slight)
"code smell". Perhaps it would have been better for
COMPILE to take just one argument, either a symbol
(to get effect #2) or a function object (to get effect #1).
It's not clear to me whether this would be an improvement.

--
Gareth McCaughan Gareth.M...@pobox.com
.sig under construc

Chris Gehlker

unread,
Nov 17, 2002, 12:44:52 AM11/17/02
to
On 11/16/02 9:53 PM, in article slrnate86l.hlo....@g.local,
"Gareth McCaughan" <Gareth.M...@pobox.com> wrote:

> Chris Gehlker wrote:
>
>> Thanks Nils and everyone else who responded. Given that functions are in a
>> separate namespace, #' does make sense. Now what still has a whiff about it,
>> for me is compile. Here's why:
> [SNIP: COMPILE gets passed the name of a function, not the function object]
>
> There are two different things you might want COMPILE to do.
>
> 1. Accept a function and return a compiled version of it.
> 2. Make a particular symbol name a compiled version of whatever
> it currently names.

[snip good explanation of why COMPILE works as it does]

Thanks Gareth. I probably should have mentioned that, since the kind people
on this list pointed me at the HyperSpec, I noticed the optional argument to
COMPILE and a lot became clearer. In particular, compile works just as I
would have expected if you pass it nil, #'FunctionName.

> Now, the fact that almost all uses of COMPILE fall into
> two categories, each of which declines to use one of
> COMPILE's two arguments, is itself a (very slight)
> "code smell".

Agreed, in the sense that you have to look it up to understand it.

> Perhaps it would have been better for
> COMPILE to take just one argument, either a symbol
> (to get effect #2) or a function object (to get effect #1).
> It's not clear to me whether this would be an improvement.

I honestly don't see how it could be improved much. Having separate
COMPILE-FROM-OBJECT and COMPILE-FROM-NAME functions seems like overkill. If
you go down that road, *every* function with optional arguments would have
to somehow reveal that the options are there.

Marc Spitzer

unread,
Nov 17, 2002, 12:50:19 AM11/17/02
to
Chris Gehlker <geh...@fastq.com> writes:

> On 11/16/02 3:28 PM, in article 86fzu18...@bogomips.optonline.net, "Marc
> Spitzer" <mspi...@optonline.net> wrote:
>
> >>
> >> But I also just made a bad assumption. On comp.lang.ruby to say that
> >> something "smells" just means that it confuses you. I should have said "Does
> >> anyone else find this confusing?"
> >>
> >
> > Well I see something smells, I think "like 2 day old fish in the
> > summer sun" or ripe garbage.
>
> Ah. It's supposed to be an analogy to the way your sense of smell conveys
> information that's hard to articulate and sort of seeps in at an unconscious
> level. I just read in Graham about being able to tell whether a building is
> made of wood or stone by its general shape when you are too far away to
> actually see the construction material. It's that same idea.

ok, but when you say it smells, you are implying that you are
qualified to make the judgment.

marc

Kenny Tilton

unread,
Nov 17, 2002, 1:07:33 AM11/17/02
to

OK, so now you want to argue about my library skills? A little rigor,
please. The question at hand was whether i had shot from the hip, not
whether I got something wrong or was not able to find a non-alpha
character in an index that ran from a to z.

Because I /did/ look up #'. (You presumed wrong, kind of a habit around
here.) I just did not find it. The index went from A to Z. I am used to
finding stuff like that in front of the alpha entries, since that is how
the char-code works out. And I was not aware Lispers call the pound sign
a sharpsign (tho that makes sense, too).

--

kenny tilton
clinisys, inc
---------------------------------------------------------------

Chris Gehlker

unread,
Nov 17, 2002, 1:55:43 AM11/17/02
to
On 11/16/02 10:50 PM, in article 86vg2wg...@bogomips.optonline.net,
"Marc Spitzer" <mspi...@optonline.net> wrote:

> Chris Gehlker <geh...@fastq.com> writes:
>
>> On 11/16/02 3:28 PM, in article 86fzu18...@bogomips.optonline.net, "Marc
>> Spitzer" <mspi...@optonline.net> wrote:
>>
>>>>
>>>> But I also just made a bad assumption. On comp.lang.ruby to say that
>>>> something "smells" just means that it confuses you. I should have said
>>>> "Does
>>>> anyone else find this confusing?"
>>>>
>>>
>>> Well I see something smells, I think "like 2 day old fish in the
>>> summer sun" or ripe garbage.
>>
>> Ah. It's supposed to be an analogy to the way your sense of smell conveys
>> information that's hard to articulate and sort of seeps in at an unconscious
>> level. I just read in Graham about being able to tell whether a building is
>> made of wood or stone by its general shape when you are too far away to
>> actually see the construction material. It's that same idea.
>
> ok, but when you say it smells, you are implying that you are
> qualified to make the judgment.

The important part of my question was "does it smell by design?" I'm just
new enough to the language to be uncertain as to whether it smelled at all
[1]. I had just read a page in Graham where he mentions that COMPILE is
generally a poor idea except in very limited circumstances and I couldn't
help but notice that it had a different functional form than all the other
functions that dealt with functions. I was curious as to whether I should
connect the dots. [2]

'Smell by design' is a feature of some languages [3] and it doesn't strike
me as illegitimate to ask if it was a feature of Common Lisp. It's not
something I could find out by reading the spec.

I don't care whether COMPILE smells or not since I will probably never use
it but I do care if certain functional forms are supposed to be a red flag
and I'm not aware of that.

[1] It doesn't.
[2] I clearly shouldn't have.
[3] C++ cast operators, for example.

Chris Gehlker

unread,
Nov 17, 2002, 2:06:39 AM11/17/02
to
On 11/16/02 11:07 PM, in article 3DD732FB...@nyc.rr.com, "Kenny Tilton"
<kti...@nyc.rr.com> wrote:

> Because I /did/ look up #'.

You probably did exactly what I did, tried to find it in the symbol index.
It's not there because it's not a "symbol".

I guess we have to trust that it will all make sense when it all makes
sense.

Kenny Tilton

unread,
Nov 17, 2002, 2:46:29 AM11/17/02
to

Chris Gehlker wrote:
> On 11/16/02 11:07 PM, in article 3DD732FB...@nyc.rr.com, "Kenny Tilton"
> <kti...@nyc.rr.com> wrote:
>
>
>>Because I /did/ look up #'.
>
>
> You probably did exactly what I did, tried to find it in the symbol index.
> It's not there because it's not a "symbol".

No, I went to A hoping the non-alpha stuff had been lumped in there
ahead of the A stuff.

Coby Beck

unread,
Nov 17, 2002, 2:59:44 AM11/17/02
to

"Chris Gehlker" <geh...@fastq.com> wrote in message
news:B9FBF3BE.23594%geh...@fastq.com...

> in a more meaningful way. I can see by the hyperspeck that
^^^^^^^^^^
I don't know why, but this struck me as one of the most amusing typos I have
seen in a long while! (no offense Chris ;)

--
Coby Beck
(remove #\Space "coby 101 @ bigpond . com")


Adam Warner

unread,
Nov 17, 2002, 2:58:18 AM11/17/02
to
Hi Kenny Tilton,

>>>Because I /did/ look up #'.
>>
>>
>> You probably did exactly what I did, tried to find it in the symbol
>> index. It's not there because it's not a "symbol".
>
> No, I went to A hoping the non-alpha stuff had been lumped in there
> ahead of the A stuff.

http://www.lispworks.com/reference/HyperSpec/Front/X_Master.htm

You might have more chance finding the "non-alpha stuff" in the section
entitled "Non-Alphabetic" ;-)

Regards,
Adam

Coby Beck

unread,
Nov 17, 2002, 3:29:30 AM11/17/02
to

"Kenny Tilton" <kti...@nyc.rr.com> wrote in message
news:3DD732FB...@nyc.rr.com...

> the char-code works out. And I was not aware Lispers call the pound sign
> a sharpsign (tho that makes sense, too).

Well, this subject came up a couple of years ago with some amusing results:
http://groups.google.com/groups?selm=39C8006A.E35E30E1%40nyc.rr.com

And...while we're beating up Kenny for his unconsionable
function/symbol-function error I will point out the link above is an article
by him so he cannot deny having read the thread! So what's this "i didn't
know" crap? Eh, Kenny? ;o)

--
Coby Beck
(remove #\Space "coby 101 @ bigpond . com")

(hoping one smiley will suffice!)


Tim Bradshaw

unread,
Nov 17, 2002, 6:19:28 AM11/17/02
to
* Duane Rettig wrote:

> Huh? Sending a function object to compile is perfectly acceptable
> (and intuitive, to me):

Well, one thing that occurred to me is what passing a function object
should do. If COMPILE took functions (other than in the two-argument
case), then what should this do?

(defun foo (x)
x)

(compile (symbol-function 'foo))

(compiled-function-p (symbol-function 'foo))

In order for this to `work' - for the call to COMPILED-FUNCTION-P to
return T, then either the function object needs to point back at the
symbol(s) whose SYMBOL-FUNCTION it is, or COMPILE needs to
destructively alter the function object (changing its type), rather
than making a new one. Those seem to me to be unreasonable
requirements. So to make this work, you give COMPILE the *name* of
the function, which allows a far simpler implementation - it just
needs to compile the function object, and then store it back into the
symbol's function definition.

--tim

Kenny Tilton

unread,
Nov 17, 2002, 11:29:41 AM11/17/02
to

Adam Warner wrote:
>>No, I went to A hoping the non-alpha stuff had been lumped in there
>>ahead of the A stuff.
>
>
> http://www.lispworks.com/reference/HyperSpec/Front/X_Master.htm
>
> You might have more chance finding the "non-alpha stuff" in the section
> entitled "Non-Alphabetic" ;-)

Doh! To make it worse, i have a version ACL includes on my HD and
NON-ALPHABETIC is in all caps, looks like a friggin billboard.

This makes me think I may never find that set of keys that has been at
large over here for going on two days now.

:)

Kenny Tilton

unread,
Nov 17, 2002, 11:37:30 AM11/17/02
to

Coby Beck wrote:
> "Kenny Tilton" <kti...@nyc.rr.com> wrote in message
> news:3DD732FB...@nyc.rr.com...
>
>>the char-code works out. And I was not aware Lispers call the pound sign
>>a sharpsign (tho that makes sense, too).
>
>
> Well, this subject came up a couple of years ago with some amusing results:
> http://groups.google.com/groups?selm=39C8006A.E35E30E1%40nyc.rr.com

Great find! Now let's see what kind of damage control i can do over this
paper trail...

>
> And...while we're beating up Kenny for his unconsionable
> function/symbol-function error I will point out the link above is an article
> by him so he cannot deny having read the thread! So what's this "i didn't
> know" crap? Eh, Kenny? ;o)

...ok, this is what the PR team came up with, after rejecting "Like most
NG regulars I do not actually read the articles to which I am responding.":

That article demonstrates # has no /one/ name so why should I have
remembered one out of twenty?

:)

Your sizzling, scorching daily Sun

unread,
Nov 17, 2002, 12:04:05 PM11/17/02
to
* Kenny Tilton wrote:

> That article demonstrates # has no /one/ name so why should I have
> remembered one out of twenty?

No, sorry, the electorate will not put up with this kind of
dissembling. The Sun (do they have tabloids in the US? What are they
called? - ed) Demands that you resign your position as minister for
Cells! This Farce CAN NOT CONTINUE! Vote for Ilias!

Kenny Tilton

unread,
Nov 17, 2002, 12:58:53 PM11/17/02
to

Mistakes were made. What if I check myself into the Betty Ford clinic
for a month, then go on Oprah to sing the National Anthem?

Will Deakin

unread,
Nov 17, 2002, 1:51:33 PM11/17/02
to
Kenny Tilton wrote:

> Mistakes were made. What if I check myself into the Betty Ford clinic
> for a month, then go on Oprah to sing the National Anthem?

I don't think you have fully considered the enormous financial benefits
that could be accrued.

If I were your PR consultant I would suggest that you claim you were
abducted by aliens, resulting in a traumatic gender crisis that required
you to enter holy orders as a nun. This could keep you going on
international daytime TV for years. (At the end of this you could then
then sell your tales of sordid nun-on-nun action to the National
Enquirer...)

;)w

Joe Marshall

unread,
Nov 18, 2002, 12:20:37 PM11/18/02
to
<t...@cley.com> (Your sizzling, scorching daily Sun) writes:

> No, sorry, the electorate will not put up with this kind of
> dissembling. The Sun (do they have tabloids in the US? What are they
> called? - ed) Demands that you resign your position as minister for
> Cells! This Farce CAN NOT CONTINUE! Vote for Ilias!

The two with the most circulation are

The National Enquirer
http://www.nationalenquirer.com/

The Star
http://www.starmagazine.com/

But aficionados of the form prefer

The Weekly World News
http://www.weeklyworldnews.com/

Donald Fisk

unread,
Nov 18, 2002, 10:19:32 PM11/18/02
to
Kenny Tilton wrote:
>
> Christopher C. Stacy wrote:
> >>>>>>On Sat, 16 Nov 2002 09:58:52 -0700, Chris Gehlker ("Chris") writes:
> >>>>>
> > Chris> Let me ask, with all due humility as a very newbie, if anyone
> > Chris> else thinks #' is a code smell? If it is a code smell, is it
> > Chris> *supposed* to be in the sense that C++ has things in it that
> > Chris> stink by design?
> >
> > #' is a built-in reader macro.
> > What is a "code smell"?
>
> http://c2.com/cgi/wiki?CodeSmell
>
> So I do not think it is a c/s, it's just an optional shorthand for (I
> think) symbol-function.

Function, as others have pointed out. It works like this:

[1]> (mapcar #'sqrt '(1 2 3))
(1 1.4142135 1.7320508)
[2]> (mapcar (function sqrt) '(1 2 3))
(1 1.4142135 1.7320508)
[3]> (mapcar sqrt '(1 2 3))

*** - EVAL: variable SQRT has no value
1. Break [4]>
[5]> (mapcar #'(lambda (x) (* x 2)) '(1 2 3))
(2 4 6)
[6]> (mapcar (function (lambda (x) (* x 2))) '(1 2 3))
(2 4 6)
[7]> (mapcar (lambda (x) (* x 2)) '(1 2 3))
(2 4 6)
[8]> (mapcar (symbol-function 'sqrt) '(1 2 3))
(1 1.4142135 1.7320508)
[9]>

As you can see, #' is a read macro for function, which
is a macro rather than a function [2].
You can omit it from lambda expressions [7], but not from
named functions [3], because Common Lisp has separate
namespaces for functions and values.

> kenny tilton

Le Hibou
--
Dalinian: Lisp. Java. Which one sounds sexier?
RevAaron: Definitely Lisp. Lisp conjures up images of hippy coders,
drugs,
sex, and rock & roll. Late nights at Berkeley, coding in Lisp fueled by
LSD.
Java evokes a vision of a stereotypical nerd, with no life or social
skills.

Donald Fisk

unread,
Nov 18, 2002, 10:30:40 PM11/18/02
to
Kenny Tilton wrote:
>
> And I was not aware Lispers call the pound sign
> a sharpsign (tho that makes sense, too).

Some of us Rightpondians are a bit tardy in converting to Euros,
so not only do we have pounds (GBP), but we have pound signs (£)
on our keyboards. I assume you know what the currency pound
sign looks like.

The confusion is presumably because the pound sign on a UKoGBaNI
keyboard is in exactly the same place as the sharp sign is on
an American keyboard, which you might not know.

Donald Fisk

unread,
Nov 18, 2002, 10:42:59 PM11/18/02
to
Chris Gehlker wrote:

> But I also just made a bad assumption. On comp.lang.ruby to say that
> something "smells" just means that it confuses you. I should have said "Does
> anyone else find this confusing?"

It doesn't mean that on the c2.com wiki, where I learned the term.

> To say that something is "surprising", on the other hand, means that it
> sucks, as in "Java is full of surprises." My God, I just insulted the
> Javaphiles here.

There either the empty set, or surprisingly tolerant for Javaphiles.
No one's taken offence to my .sig yet.

I'm not quite sure what Java surprises you have in mind anyway -- the
language was designed to be comfortable for the average programmer,
so surprises have been kept to a minimum.

OTOH Lisp has lots of surprises -- but most certainly doesn't suck.

Kenny Tilton

unread,
Nov 18, 2002, 10:47:13 PM11/18/02
to

Donald Fisk wrote:
> As you can see, #' is a read macro for function, which
> is a macro rather than a function [2].
> You can omit it from lambda expressions [7], but not from
> named functions [3], because Common Lisp has separate
> namespaces for functions and values.
>

Thx for the detailed breakdown.

Erik Naggum

unread,
Nov 18, 2002, 11:17:47 PM11/18/02
to
* Donald Fisk

| Some of us Rightpondians are a bit tardy in converting to Euros, so not
| only do we have pounds (GBP), but we have pound signs (£) on our
| keyboards. I assume you know what the currency pound sign looks like.

It appears that many British English users do not know that #5 is
pronounced "number 5" and 5# is pronounced "5 pounds", as in lbs, and to
American English users, # is therefore equally "number sign" and "pound
sign". Oxford Reference Online does not even sport "number sign" despite
the 100 reference works they span. Neither does The New Oxford American
Dictionary, but all real American references list both meanings of "pound
sign" and have a "number sign", too.

--
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

unread,
Nov 18, 2002, 11:20:32 PM11/18/02
to
* Donald Fisk

| No one's taken offence to my .sig yet.

That could be because it is so horribly formatted as to be better ignored
than read. With line breaks like that, people need a lot of goodwill up
front even to bother with the text. For your benefit, it has been quoted
as it appears to everyone else, verbatim:

| --
| Dalinian: Lisp. Java. Which one sounds sexier?
| RevAaron: Definitely Lisp. Lisp conjures up images of hippy coders,
| drugs,
| sex, and rock & roll. Late nights at Berkeley, coding in Lisp fueled by
| LSD.
| Java evokes a vision of a stereotypical nerd, with no life or social
| skills.
|

--

Chris Gehlker

unread,
Nov 19, 2002, 12:00:29 AM11/19/02
to
On 11/18/02 8:42 PM, in article 3DD9B343...@enterprise.net, "Donald
Fisk" <hibou000...@enterprise.net> wrote:

> Chris Gehlker wrote:
>
>> But I also just made a bad assumption. On comp.lang.ruby to say that
>> something "smells" just means that it confuses you. I should have said "Does
>> anyone else find this confusing?"
>
> It doesn't mean that on the c2.com wiki, where I learned the term.

I've seen this and I think it's a very good description of what the author
meant. The term does get used more loosely though, I the sense of "its
confusing."

>
>> To say that something is "surprising", on the other hand, means that it
>> sucks, as in "Java is full of surprises." My God, I just insulted the
>> Javaphiles here.
>
> There either the empty set, or surprisingly tolerant for Javaphiles.
> No one's taken offence to my .sig yet.

There probably aren't many here.

> I'm not quite sure what Java surprises you have in mind anyway -- the
> language was designed to be comfortable for the average programmer,
> so surprises have been kept to a minimum.

I think that's a large part of the problem for the many people who, like me,
find using java to be about as comfortable as as a lower GI. It looks like
other languages which are very popular but it acts like Java. One is always
stubbing one's toe on the fact that some built-in/standard library types are
first class objects and others aren't, that you have to remember to cast an
object back to what it is just because you took it out of a container, an
other small annoyances. That and the fact that the GC would notoriously
break just about when your project was getting up to real size are the big
issues.

I could go on about what's wrong with Java but it's all been said before.

> OTOH Lisp has lots of surprises -- but most certainly doesn't suck.

AFAICT, Lisp doesn't have *any* surprises in the sense that I mean. By no
surprises I simply mean that it is possible to develop an intuition for how
the language works and then think through the language to the problem domain
rather than thinking about the language. I'm pretty confident that I can do
that with Lisp.

Fortran may be a clunky languages but it does embody a consistent vision of
what a program is and the user can start thinking in Fortran instead of
thinking about what she is trying to do and having to translate her ideas
into Fortran. For me, anyway, the same applies to C++, Ruby, Smalltalk, C,
ObjC and FORTH. But I never got there in Pascal or Java even though I have
written a fair amount of both. I try to think through the language to what I
am trying to do but the mechanics of the language start intruding.

This may be a very idiosyncratic thing. I know some folks are very
comfortable in Java. I hope it made some kind of sense.

Kenny Tilton

unread,
Nov 19, 2002, 1:31:11 AM11/19/02
to

Chris Gehlker wrote:
> AFAICT, Lisp doesn't have *any* surprises in the sense that I mean.

At pain of repeating what I just said elsewhere, that was a striking
feature of Lisp early on, and I think it may well have been something I
saw in a famous quotation about Lisp, something to the effect that when
I looked up some function wondering how it treated its parameters, it
somehow always turned out that the function worked just as I hoped.

This happened so often that I came to trust the designers of Lisp, and
when a function did /not/ work the way I expected, I questioned my
expectations.

Michael Hudson

unread,
Nov 19, 2002, 7:33:38 AM11/19/02
to
t...@apocalypse.OCF.Berkeley.EDU (Thomas F. Burdick) writes:

[#' is a reader macro for...]

> Heh, I'd think an even more succinct example would be:

Or:

* (car '#'sin)

FUNCTION

Cheers,
M.

--
I'm sorry, was my bias showing again? :-)
-- William Tanksley, 13 May 2000

Marco Antoniotti

unread,
Nov 19, 2002, 9:03:53 AM11/19/02
to

Erik Naggum <er...@naggum.no> writes:

> * Donald Fisk
> | Some of us Rightpondians are a bit tardy in converting to Euros, so not
> | only do we have pounds (GBP), but we have pound signs (£) on our
> | keyboards. I assume you know what the currency pound sign looks like.
>
> It appears that many British English users do not know that #5 is
> pronounced "number 5" and 5# is pronounced "5 pounds", as in lbs, and to
> American English users, # is therefore equally "number sign" and "pound
> sign". Oxford Reference Online does not even sport "number sign" despite
> the 100 reference works they span. Neither does The New Oxford American
> Dictionary, but all real American references list both meanings of "pound
> sign" and have a "number sign", too.

The ASCII keyboards have always played fun tricks with non English
speakers. The #\# character in particular has accumulated a largish
set of names among Italian speakers, some of which kind of hilarious
because of their dialectal flair. I believe the first name assined
to the #\# character in Italian was `diesis' (as in `Fa diesis'): a
name of musical origin. However, it really does not sound all that
Italian and the masses have opted for `cancelletto' (`little gate' or
`grate'). From there the jump to the very Tusca/Roman sounding
`gratella' ('little cute grate') is very small :)

Other interesting `fluff' stories regard the names of #\& and #\@. #\&
was known into Italian (I remember it on the household Olivetti
Lettera mechanical typewriter) as `commercial "and"' (I believe it
must have been an import as well, since the congiunction `and' is a
simple `e' in Italian). #\@ did not have a name until it started to
appear in the 80's on Italian keyboards. The name it got is the
widespread `chioccioletta' ('little cute snail'). A name that is
warm, fuzzy, and ... cute.

Cheers

PS. One of the greatest jokes I heard about Windows XP in Italy is the
following: "WXP was made by Clementoni". "Clementoni" being the
houshold name for "Fisher Prize". Is the future of computing
"warm, fuzzy and childlike"?

--
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'.

Donald Fisk

unread,
Nov 19, 2002, 2:35:27 PM11/19/02
to
Erik Naggum wrote:
>
> * Donald Fisk
> | No one's taken offence to my .sig yet.
>
> That could be because it is so horribly formatted as to be better ignored
> than read.

Netscape does that.

> Erik Naggum, Oslo, Norway

Fixed, I think. Now someone will complain it's too long.

Le Hibou

Joe Marshall

unread,
Nov 19, 2002, 3:13:12 PM11/19/02
to
Marco Antoniotti <mar...@cs.nyu.edu> writes:

> I believe the first name assined
> to the #\# character in Italian was `diesis' (as in `Fa diesis'): a
> name of musical origin. However, it really does not sound all that
> Italian and the masses have opted for `cancelletto' (`little gate' or
> `grate'). From there the jump to the very Tusca/Roman sounding
> `gratella' ('little cute grate') is very small :)

The INTERCAL convention is to call the '#' character `mesh'

Thomas A. Russ

unread,
Nov 19, 2002, 12:53:33 PM11/19/02
to
Chris Gehlker wrote:

> Now that you've shown me this great reference, I can formulate the question
> in a more meaningful way. I can see by the hyperspeck that the argument to
> COMPILE is a function name and the argument to COMPILED-FUNCTION-P is an
> object. I assume that there is some underlying rationale for choosing the
> argument types for functions and that an experienced Lisp programmer will
> know, or at least be able to guess most of the time, what argument is
> appropriate for any given function. How does one develop such intuition?

Some of this is just exposure to the language. You learn what arguments
make sense for which functions.

For the case of COMPILE, the reason it wants the name of the function as
its first argument rather than the function object has to do with
providing a convenient service for the user. If you just hand COMPILE
the function object associated with a name, then the COMPILE function
can't replace the uncompiled function with its compiled version. That
is because the function object exists independently of the name. This
latter point is something that is not common in other programming
languages. [Yes, they often have pointers to functions, but
manipulation of function objects is much more of an esoteric thing to do
in those languages, while it isn't all that uncommon in lisp.]

There is (as Duane Rettig points out in another post) an optional second
argument to COMPILE which is a function object. In that case the result
of compilation is fbound to the first argument (unless that first
argument is NIL, in which case the compiled function is returned).

What does this mean operationally? Well it means that if you were
to do something like

(defun foo (x) (* x x))

you could get similar results from either of the following forms:

(compile 'foo)
(setf (symbol-function 'foo) (compile nil #'foo))

You could also do an end run around DEFUN entirely and do

(setf (symbol-function 'foo) (compile nil #'(lambda (x) (* x x))))

or more simply

(compile 'foo #'(lambda (x) (* x x)))

;;;

Now, this is all a bit esoteric for most new users, since generally one
doesn't call COMPILE all that much. Normally one would write the
functions in a file using a text editor and then compile the file (using
COMPILE-FILE) and load the result (using LOAD). For convenience, the
COMPILE-FILE function returns the name of the compiled file, so you can
just do

(load (compile-file "my-lisp-file.lisp"))

and have the compiled coded loaded.

--
Thomas A. Russ, USC/Information Sciences Institute t...@isi.edu

Marco Antoniotti

unread,
Nov 19, 2002, 4:24:56 PM11/19/02
to

Joe Marshall <j...@ccs.neu.edu> writes:

Of course :)

Cheers

Tim Daly, Jr.

unread,
Nov 19, 2002, 8:37:05 PM11/19/02
to
Joe Marshall <j...@ccs.neu.edu> writes:

My favorite has always been 'octothorp'. It describes the glyph, but
doesn't imply a meaning. 'Mesh' sounds similar, but I don't know if I
want to adopt any INTERCAL conventions today...

-Tim

Jens Kilian

unread,
Nov 20, 2002, 6:50:15 AM11/20/02
to
Marco Antoniotti <mar...@cs.nyu.edu> writes:
> Other interesting `fluff' stories regard the names of #\& and #\@. #\&
> was known into Italian (I remember it on the household Olivetti
> Lettera mechanical typewriter) as `commercial "and"' (I believe it
> must have been an import as well, since the congiunction `and' is a
> simple `e' in Italian).

I'd almost bet that the ampersand character was *invented* in Italy.
It's just a squiggly way of writing the Latin 'et'; in some italic (ha!)
typefaces the ampersand clearly looks like a ligature 'Et'.
--
mailto:j...@acm.org phone:+49-7031-464-7698 (TELNET 778-7698)
http://www.bawue.de/~jjk/ fax:+49-7031-464-7351
PGP: 06 04 1C 35 7B DC 1F 26 As the air to a bird, or the sea to a fish,
0x555DA8B5 BB A2 F0 66 77 75 E1 08 so is contempt to the contemptible. [Blake]

0 new messages