Re: Seeking computer-programming job (Sunnyvale, CA)

T

Tim Bradshaw

Or ever use the same one twice. Kinda limits their usefulness
methinks.

I know you won't listen [so why am I wasting my time?] but you *really*
need to actually make some effort to understand CL (or Lisp in general)
because this kind of statement is just making you look silly.

For instance, consider this macro:

(defmacro collecting (&body forms)
(let ((ln (make-symbol "LIST"))
(ltn (make-symbol "TAIL")))
`(let ((,ln '())
(,ltn '()))
(flet ((collect (it)
(if (null ,ltn)
(setf ,ln (list it)
,ltn ,ln)
(setf (cdr ,ltn) (list it)
,ltn (cdr ,ltn)))
it))
(progn
,@forms
,ln)))))

This uses two gensyms (I've made them with MAKE-SYMBOL, so I can give
them print names which help, but they are uninterned symbols.

Now, what does the expansion of this look like?

? (macroexpand
'(collecting
(collect 1)
(collect 2)))
(let ((#:list 'nil) (#:tail 'nil))
(flet ((collect (it)
(if (null #:tail)
(setf #:list (list it) #:tail #:list)
(setf (cdr #:tail) (list it) #:tail (cdr #:tail)))
it))
(progn (collect 1) (collect 2) #:list)))

Except, of course, those uninterned symbols are actually *the same two
symbols* each time they are used, as you can see from the macro
definition. Fortunately there is a machanism of showing this: set
*PRINT-CIRCLE* to true:

? (macroexpand
'(collecting
(collect 1)
(collect 2)))
(let ((#2=#:list 'nil) (#1=#:tail 'nil))
(flet ((collect (it)
(if (null #1#)
(setf #2# (list it) #1# #2#)
(setf (cdr #1#) (list it) #1# (cdr #1#)))
it))
(progn (collect 1) (collect 2) #2#)))
 
L

Lew

Tim said:
Or ever use the same one twice. Kinda limits their usefulness
methinks.

I know you won't listen [so why am I wasting my time?] but you *really*
need to actually make some effort to understand CL (or Lisp in general)
because this kind of statement is just making you look silly.

Wow. You guys are still arguing with the troll after all this time?

Amazing.

I'm not sure how this topic made it through my filters but I'll block it again.
 
P

Pascal J. Bourguignon

Tim Bradshaw said:
This uses two gensyms (I've made them with MAKE-SYMBOL, so I can give
them print names which help, but they are uninterned symbols.

Better use (gensym "LIST-") and (gensym "TAIL-") so you can
distinguish them when you macroexpand:
(collecting (collect (collecting (collect 1) (collect 2)))
(collect (collecting (collect 3) (collect 4))))
 
S

Series Expansion

I know you won't listen

To ad hominems? No.
but you *really* need to

I do not "*really* need to" do anything on your say-so, as a matter of
fact.
because this kind of statement is just making you look silly.

These tiresome personal attacks do not constitute rational arguments
in favor of either Lisp or Java, Tim.
? (macroexpand
   '(collecting
     (collect 1)
     (collect 2)))
(let ((#:list 'nil) (#:tail 'nil))
  (flet ((collect (it)
           (if (null #:tail)
               (setf #:list (list it) #:tail #:list)
               (setf (cdr #:tail) (list it) #:tail (cdr #:tail)))
           it))
    (progn (collect 1) (collect 2) #:list)))

And if what you've said about "uninterned" symbols is correct, this
won't behave as advertised if read in and evaluated.

You now have two options:
1. It just plain doesn't work, and I win.
2. It somehow does work, in which case replacing a macro invocation
with its expansion does NOT work, not always having the same
semantics as leaving the macro invocation as a macro invocation,
because there's some sort of "magic" involved. In which case I win
again because then your "macros" not only aren't true macros, but
furthermore do something very weird, confusing, and therefore
evil.
 
S

Series Expansion

I know you won't listen [so why am I wasting my time?] but you *really*
need to actually make some effort to understand CL (or Lisp in general)
because this kind of statement is just making you look silly.
Wow.  You guys are still arguing with the troll after all this time?

These tiresome personal attacks do not constitute rational arguments
in favor of either Lisp or Java, "Lew" and Tim.
 
T

Tim Bradshaw

And if what you've said about "uninterned" symbols is correct, this
won't behave as advertised if read in and evaluated.

That's correct. But only because the printer, with default settings,
does not attempt to detect all the sharing in structures it prints.
Since, in this code, there is sharing, the printed form does not
properly represent the code. As I said, if you set *PRINT-CIRCLE*
true, then the printer *does* try and detect sharing, and will print
something which can be read in and will work (this is not always the
case, since not all structures can be printed readably at all, but it
is true here). Of course none of this affects the macro's behaviour at
all because it does not rely on the printer or reader.
 
L

lors

This has already been repeated 5 times in this thread. The guy won't
learn, no matter what you may write on usenet. The only way left is
to hit him on the head. Are you prepared to buy a rule and pay the
flight fare to go see him and do the needed pedagogical actions? If
not, PLEASE, just leave it, stop posting in this thread.
Be fine if "stop posting" actually did have any effect as a
function. Hands over ears has never worked with this type of
asshole. Yo got it very right with
/qThe only way left is
to hit him on the head
/q
As "Seamus Macrae" the asshole is invading the free news
server froup.. a service for us all supplied through the
goodwill of NNTP admins.
I am looking for history on this guy before the 15th of June
2009. IT was not "born" yesterday.
I can be contacted here:
lors.washin at yahoo.com

fup set to comp.lang.lisp

For whatever assistance is provided, thanks.
 
A

Arne Vajhøj

Series said:
Tim said:
On 2009-07-11 04:01:32 +0100, Series Expansion <[email protected]> said:
On 2009-07-03 20:45:43 +0100, Series Expansion <[email protected]> said:
Is that a threat?
[calls me a liar]
How ridiculous of you.
Actually, the text you replaced above with "[calls me a liar]" was "No,
it's an elegy".
I would assume that it was a parody.

Then you would be wrong.

Are you Kenneth Tilton?

If not then how would know that it was not a parody?

Arne
 
A

Arne Vajhøj

Series said:
These tiresome personal attacks do not constitute rational arguments
in favor of either Lisp or Java, Arne.

No.

But it prevents readers from thinking that source code can only
be ASCII and UTF-16, which is not the case.

Arne
 
S

Series Expansion

These tiresome personal attacks do not constitute rational arguments
in favor of either Lisp or Java, Arne.

No.

But [calls me a liar]

These tiresome personal attacks do not constitute rational arguments
in favor of either Lisp or Java, Arne.
 
S

Series Expansion

Series said:
Tim Bradshaw wrote:
On 2009-07-11 04:01:32 +0100, Series Expansion <[email protected]> said:
On 2009-07-03 20:45:43 +0100, Series Expansion <[email protected]> said:
Is that a threat?
[calls me a liar]
How ridiculous of you.
Actually, the text you replaced above with "[calls me a liar]" was  "No,
it's an elegy".
I would assume that it was a parody.
Then you would be wrong.

Are you Kenneth Tilton?

If not then how would know that it was not a parody?

Simple. When I said "[calls me a liar]", I was not intending it as a
parody. Thus I know it was not a parody.
 
S

Series Expansion

My impression is that so far *all* people have.

People have all kinds of impressions that don't necessarily correlate
all that strongly with reality. Particularly not when they, like you,
are idiots.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top