Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Implementation Favoritism, a question of Lisp mindsets
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 201 - 225 of 262 - Collapse all  -  Translate all to Translated (View all originals) < Older  Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Zachary Beane  
View profile  
 More options May 1 2003, 10:55 pm
Newsgroups: comp.lang.lisp
From: x...@xach.com (Zachary Beane)
Date: Thu, 01 May 2003 21:54:55 -0500
Local: Thurs, May 1 2003 10:54 pm
Subject: Re: Implementation Favoritism, a question of Lisp mindsets

In article <010520031615039580%nos...@iam.invalid>, Mark Conrad wrote:
> In article <m3n0i6k8wz....@javamonkey.com>, Peter Seibel
><pe...@javamonkey.com> wrote:

>> > Is relying on "define-symbol-macro" going to get me into trouble down
>> > the road, in your estimation.

>> I'd say yes. Until you get a deeper understanding of what macros,
>> variables, closures, etc. actually are. I'd reiterate the point
>> someone made a couple weeks ago--learn Lisp. Use it the way it was
>> intended to be used. Get it under your fingers.

> So far as learning Lisp from books is concerned, I have not had any
> luck resolving issues like the ones we are discussing here.

It seems you have made up your mind in advance what is useful and what
is not, and you only accept from books information that confirms your
prejudices.

> In other words, there are things that can only be learned by asking
> specific questions in NG's like this one.

People in the newsgroup are able to react to your prejudices in ways
that books can't. This says more about your mental incapacity than
about the usefulness of the newsgroup as a learning tool.

Zach


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Bradshaw  
View profile  
 More options May 2 2003, 3:01 am
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@cley.com>
Date: 02 May 2003 07:49:52 +0100
Local: Fri, May 2 2003 2:49 am
Subject: Re: Implementation Favoritism, a question of Lisp mindsets

* Fred Gilham wrote:
> (For the humor impaired, the above is ENTIRELY tongue-in-cheek!)

Now come on, you know that's not true.  You were in the room when we
voted to dispatch the helicopters.

--tim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Conrad  
View profile  
 More options May 2 2003, 4:39 am
Newsgroups: comp.lang.lisp
From: Mark Conrad <nos...@iam.invalid>
Date: Fri, 02 May 2003 08:40:06 GMT
Local: Fri, May 2 2003 4:40 am
Subject: Re: Implementation Favoritism, a question of Lisp mindsets
In article <86fznyurn4....@bogomips.optonline.net>, Marc Spitzer

<mspit...@optonline.net> wrote:
> > They correct me, and I learn.

> Well just consider this another correction.

I do, thanks for taking the time and effort.

I can see be the general tone of the responses lately that I have worn
out my welcome here.

Thanks to all here for helping me learn, I appreciated it immensely.

I would have liked to continue, but that does not seem possible because
my preferred method of learning tends to infuriate people here.

I noted that there was one side thread where the poster wrote that he
gained valuable insite from the posts in  _this_  thread, so I feel
somewhat vindicated by my "fool's-approach" to acquiring knowledge.

Cool down fellas, and remember:

Old CL newbie fools never die, they just   f-a-a-a-d-e   away.

Mark-


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Conrad  
View profile  
 More options May 2 2003, 4:53 am
Newsgroups: comp.lang.lisp
From: Mark Conrad <nos...@iam.invalid>
Date: Fri, 02 May 2003 08:53:37 GMT
Local: Fri, May 2 2003 4:53 am
Subject: Re: Implementation Favoritism, a question of Lisp mindsets
In article <ey3he8du9kf....@cley.com>, Tim Bradshaw <t...@cley.com>
wrote:

> * Fred Gilham wrote:

> > (For the humor impaired, the above is ENTIRELY tongue-in-cheek!)

> Now come on, you know that's not true.  You were in the room when we
> voted to dispatch the helicopters.

> --tim

I am hiding!

Mark-


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marc Spitzer  
View profile  
 More options May 2 2003, 6:46 am
Newsgroups: comp.lang.lisp
From: Marc Spitzer <mspit...@optonline.net>
Date: Fri, 02 May 2003 10:46:01 GMT
Local: Fri, May 2 2003 6:46 am
Subject: Re: Implementation Favoritism, a question of Lisp mindsets

In all honesty you would have no problem staying here iff you changed
one thing in your preferred method of learning, stop assuming you are
right when you do not know what you are talking about.  If you are
truly trying to learn something then you only need to be corrected once
on any given point, look at your continuations thread for a counter
example.  

> I noted that there was one side thread where the poster wrote that he
> gained valuable insite from the posts in  _this_  thread, so I feel
> somewhat vindicated by my "fool's-approach" to acquiring knowledge.

That is besides the point, your preferred method is designed to piss
people off and this is counter productive from you POV as someone who
want to learn something.  You may get a better response from
c.l.python or c.l.perl because you have more people to piss off until
you can not get any more help, but it is still daft to do this.

marc


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thomas F. Burdick  
View profile  
 More options May 2 2003, 2:21 pm
Newsgroups: comp.lang.lisp
From: t...@conquest.OCF.Berkeley.EDU (Thomas F. Burdick)
Date: 02 May 2003 11:21:10 -0700
Local: Fri, May 2 2003 2:21 pm
Subject: Re: Implementation Favoritism, a question of Lisp mindsets

Gareth McCaughan <Gareth.McCaug...@pobox.com> writes:
> (I'm not as convinced as some people here that it's
> a very bad way to learn. There's something to be said
> for jumping in at the deep end, and there's a lot to
> be said for learning by doing something that motivates
> you. But you have to be aware that you're running the
> risk of annoying the people you depend on for help
> so much that they give up...)

It's not a bad way to learn, provided you have a tutor who is willing
to go along with it.  I once tutored someone in math, who, despite
getting straight C's in high school math, had semi-grandiose theories
about how math worked, which he would explain to me.  This approach
paid off, and he ended out getting a good score on his Math SAT.
However, this *only* works if you have a tutor who's willing to go
along with it (the OP seems to need repetition).  Otherwise, it's
simply antisocial behavior.

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paolo Amoroso  
View profile  
 More options May 2 2003, 4:03 pm
Newsgroups: comp.lang.lisp
From: Paolo Amoroso <amor...@mclink.it>
Date: Fri, 02 May 2003 21:48:00 +0200
Subject: Re: Implementation Favoritism, a question of Lisp mindsets
On 02 May 2003 07:49:52 +0100, Tim Bradshaw <t...@cley.com> wrote:

> Now come on, you know that's not true.  You were in the room when we
> voted to dispatch the helicopters.

(room t)

Paolo
--
Paolo Amoroso <amor...@mclink.it>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Conrad  
View profile  
 More options May 2 2003, 5:28 pm
Newsgroups: comp.lang.lisp
From: Mark Conrad <nos...@iam.invalid>
Date: Fri, 02 May 2003 21:29:04 GMT
Local: Fri, May 2 2003 5:29 pm
Subject: Re: Implementation Favoritism, a question of Lisp mindsets
In article <861xzh4oew....@bogomips.optonline.net>, Marc Spitzer

<mspit...@optonline.net> wrote:
> ...<snipped>...is designed to piss people off...<snipped>...

A dangling point remains to be addressed before I leave this NG.

Thanks to the unknown poster who contributed code below:
*********************************************

* Mark Conrad wrote:
> Now if "closure???" looks like a duck, sounds like a duck, and waddles
> like a duck, as far as I am concerned it is a duck.

But it doesn't, does it?  Try this:

(let ((x 1))
  (defun x () x)
  (defun set-x (new)
    (setf x new)))
*********************************************

Running his code in MCL ver' 4.3
? (x)
1
? (set-x 3)
3
? (x)
3
?

At the very least, this is unexpected behavior.  It is yet another
exception to the general behavior of CL that has to be memorized and
allowed for so it won't bite me later.

Lisp gurus somehow learn the exceptions to general rules, (as those
rules are laid down in the books), but the only way I had to learn
about the nasty behavior above was to make a rash statement about how I
thought the cookie crumbled, then sit back and wait for agreement or
disagreement to my rash statement.

At the worst, something is broken somewhere in the CL implementation or
in the CL hyperspec, and should be changed.

Contrast that posters example with my variation below which runs as it
should run.

(defvar a)
(defvar b)

(let ((x 'value-of-lexical-x) (y 'value-of-lexical-y))
    (setq a x)
    (setq b y)
    (setq x 'screwed-up-value-of-lexical-x)
    (setq y 'screwed-up-value-of-lexical-y)
    (values))

? a
VALUE-OF-LEXICAL-X

? b
VALUE-OF-LEXICAL-Y

Now let's make small changes in my above code to demonstrate the
unexpected nasty behavior, nasty behavior that is  *not*  explained in
any of the books that have been recommended to me in this NG.

(defvar a)
(defvar b)

(let ((x 'value-of-lexical-x) (y 'value-of-lexical-y))
    (setq a  #'(lambda () x))
    (setq b  #'(lambda () y))
    (setq x 'screwed-up-value-of-lexical-x)
    (setq y 'screwed-up-value-of-lexical-y)
    (values))

? (funcall a)
SCREWED-UP-VALUE-OF-LEXICAL-X

? (funcall b)
SCREWED-UP-VALUE-OF-LEXICAL-Y

I don't want to "piss people off" so this will likely be my last post
in this NG.

I can see now why there are so few new newbies adopting CL as their
preferred language, when it is apparent how cantankerous and downright
ornery people are in this NG.

Mark-


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nikodemus Siivola  
View profile  
 More options May 2 2003, 6:08 pm
Newsgroups: comp.lang.lisp
From: Nikodemus Siivola <tsiiv...@kekkonen.cs.hut.fi>
Date: 2 May 2003 22:12:32 GMT
Local: Fri, May 2 2003 6:12 pm
Subject: Re: Implementation Favoritism, a question of Lisp mindsets

Mark Conrad <nos...@iam.invalid> wrote:
> At the very least, this is unexpected behavior.  It is yet another
> exception to the general behavior of CL that has to be memorized and
> allowed for so it won't bite me later.

No! This means that you do not understand what bindings, closures or
object identity mean. You know the words and have some mental constructs
about them, but *they are wrong*. Do yourself a favor and read SICP. From
the beginning. You may even learn something.

Cheers,

 -- Nikodemus


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Bradshaw  
View profile  
 More options May 2 2003, 6:09 pm
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@cley.com>
Date: 02 May 2003 23:02:34 +0100
Local: Fri, May 2 2003 6:02 pm
Subject: Re: Implementation Favoritism, a question of Lisp mindsets

* Mark Conrad wrote:
> At the very least, this is unexpected behavior.  It is yet another
> exception to the general behavior of CL that has to be memorized and
> allowed for so it won't bite me later.

Of course it isn't.  This *is* the general behaviour.  As people have
repeatedly said, closures capture *bindings*, not values Lexical
bindings in Common Lisp have lexical scope and indefinite extent, and
are mutable.  I don't think you understand what a closure is at all.

I must admit to being rather confused now though.  At some point
earlier in the thread you were enthusing about wanting to do
everything with continuations and complaining that it was a deficiency
that CL didn't have call/cc.

Well, one fairly common view of continuations (and, I expect, how they
would appear in a CL which did have them), is that they are simply the
generalisation of closures to include block names and possibly other
control points, which currently have lexical scope and dynamic extent,
to have lexical scope and indefinite extent.

How can you want call/cc and *not* understand what a lexical closure
is?  Do you actually have any *idea* what a continuation is, or are
you just repeating some magic phrase that you read?

Incidentally I liked this:

> At the worst, something is broken somewhere in the CL implementation
> or in the CL hyperspec, and should be changed.

You don't trade under the name `ilias' do you?

--tim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gareth McCaughan  
View profile  
 More options May 2 2003, 6:46 pm
Newsgroups: comp.lang.lisp
From: Gareth McCaughan <Gareth.McCaug...@pobox.com>
Date: Fri, 2 May 2003 23:31:56 +0100
Local: Fri, May 2 2003 6:31 pm
Subject: Re: Implementation Favoritism, a question of Lisp mindsets

Mark Conrad wrote:

[someone else:]

How so? It's *exactly* the expected behaviour.
This is precisely what closures are about. What
general behaviour do you think it's an exception to?
What is it about this behaviour that makes you
call it "nasty" later on?

Why's it nasty? I'd ask "why's it unexplained?", but
that's not really the right question. The right question
is: What is it you think you know that makes it
*require* explanation?

I'm not asking just out of curiosity, by the way.
I'd like to explain, but I don't see how to explain
until I know what it is that needs explaining. Maybe
this potted summary will help in the interim:

It's common to say that (1) a closure is a function
plus its environment, and (2) an environment is a
mapping from names to values. In fact, I've said
both those things several times myself. But #2 may
be misleading, because an environment is a *changeable*
mapping from names to values. It might be better to
call it a mapping from names to *value-holders*, or,
more simply, to variables. So, when you say

    (let ((x 'value-of-lexical-x) (y 'value-of-lexical-y))
      ...)

you have created new variables X and Y. They're visible
only within the scope of the LET (unless X or Y has been
declared special, of course). But they're real variables,
and they continue to exist after the LET form has finished
being processed.

Now, the things you've put into A and B inside the LET
form are closures: each is a function plus (a reference
to) its environment. That environment consists of the
bindings of X and Y. Note: the *bindings*, not the
*values*. If you change what X and Y are bound to,
that change is visible to the closures in A and B.

Which is exactly what happens when you do the third
and fourth SETQs. The closures in A and B still refer
to the same variables X and Y, but now the values of
those variables have changed.

You obviously find this nasty, but I don't know why.
Here's an example of somewhere where it might be
useful. The MAPHASH function calls a user-supplied
function for each (key, value) pair in a hash table.
So you can do things like this:

    (let ((boring-keys nil))
      (maphash (lambda (k v)
                 (when (null v)
                   (push k boring-keys)))
               *my-hash-table*)
      (format t "~&Boring keys:~{ ~A~^,~}." boring-keys)
      (do-something-else-with boring-keys))

Notice that what you're passing into MAPHASH is a closure
that needs to be able to alter BORING-KEYS.

As it happens, you can do that without closures with
either LOOP or WITH-HASH-TABLE-ITERATOR. So here's another
example. Suppose you're doing some kind of mathematical
computing; numerical integration, perhaps. You have a
bunch of algorithms you've been developing for adaptive
quadrature (i.e., calculating integrals to a prescribed
level of accuracy, working out what function evaluations
they need to do to achieve that accuracy) and you want
to see how they compare. Then:

  - You can count the number of times one of the algorithms
    evaluates the function, like this:

        (defun count-evaluations (integrator integrand)
          (let ((n 0))
            (funcall integrator (lambda (x) (incf n) (funcall integrand x))
                                *lower-bound* *upper-bound*)
            n))

  - You can get a list of the arguments at which it evaluates
    the function, like this:

        (defun evaluation-points (integrator integrand)
          (let ((result '()))
            (funcall integrator (lambda (x)
                                  (push x result)
                                  (funcall integrand x))
                                *lower-bound* *upper-bound*)
            result))

  - You can count the number of times it does two successive
    evaluations very close together, like this:

        (defun count-near-repetitions (integrator integrand)
          (let ((n 0)
                (last nil))
            (funcall integrator (lambda (x)
                                  (when (and last (<= (abs (- x last)) *delta*))
                                    (incf n))
                                  (setq last x)
                                  (f x))
                                *lower-bound* *upper-bound*)
            n))

All this without having to make any change to the code
of the integrators or the integrand functions. And this
*requires* the ability to alter variables you've closed
over. You call that "nasty", but it isn't nasty; it's
at least half of the point.

> I don't want to "piss people off" so this will likely be my last post
> in this NG.

If you want to answer my questions above by e-mail,
feel free. But I doubt answering them in c.l.l will
piss anyone off very much.

> I can see now why there are so few new newbies adopting CL as their
> preferred language, when it is apparent how cantankerous and downright
> ornery people are in this NG.

I think you'd find much less cantankerousness if you
didn't assume that whenever CL doesn't behave the way
you expect it to that indicates something broken with
either CL or the books you're reading. You'd learn
faster, too :-).

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Fred Gilham  
View profile  
 More options May 2 2003, 7:37 pm
Newsgroups: comp.lang.lisp
From: Fred Gilham <gil...@snapdragon.csl.sri.com>
Date: 02 May 2003 16:37:03 -0700
Local: Fri, May 2 2003 7:37 pm
Subject: Re: Implementation Favoritism, a question of Lisp mindsets

Mark Conrad writes:
> At the worst, something is broken somewhere in the CL implementation
> or in the CL hyperspec, and should be changed.

Oh my.  Seldom does one find oneself so completely confirmed in one's
expectation.... :-)

Backing up a little, Mark wrote:

Your comment that this is unexpected is fine.  It is discoveries like
this that were the bait that caught me when I first started with
Lisp.

But it isn't an exception to the general behavior.  It is a new idea.
It goes along with Lisp.  This is how closures work.  It's not nasty
behavior.  It's wonderful.  It's part of the underlying stratum of
object-oriented programming.

If you like continuations how can you not like this?

> I don't want to "piss people off" so this will likely be my last
> post in this NG.

> I can see now why there are so few new newbies adopting CL as their
> preferred language, when it is apparent how cantankerous and
> downright ornery people are in this NG.

Well, you could just try to roll with the punches and figure out what
is pissing people off, and do a little less of it.

Most people in this newsgroup have at least a bit of the language
evangelist in them, and if you stay good humored you can probably do
fine.  There is kind of an expectation that eventually you'll graduate
beyond newbie-hood, but I'm sure you haven't worn out your welcome
yet.  Honestly, even if you post things people think are nonsense you
will always find those ready to rise up in anger to smite you, and you
could even glean information from that.

--
Fred Gilham                                   gil...@csl.sri.com
Jordan Hubbard: We have a crash bug.  It needs to be fixed. We DO NOT
need to know how to print 3000 spaces in 11 different languages! :-)
Daniel Sobral: I concur. But if anyone wants to do it with loader,
: 3kbl 3000 0 do bl emit loop ; 3kbl will do the trick.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matthew Danish  
View profile  
 More options May 2 2003, 9:27 pm
Newsgroups: comp.lang.lisp
From: Matthew Danish <mdan...@andrew.cmu.edu>
Date: Fri, 2 May 2003 21:18:03 -0400
Local: Fri, May 2 2003 9:18 pm
Subject: Re: Implementation Favoritism, a question of Lisp mindsets

Okay.  Since it seems to require at least 5 people yelling at you to get any
point through, here is my contribution:

********************************
What you demonstrate IS the general and expected behavior.  You do not
understand anything about how closures work in Common Lisp.  Stop telling us
that we are wrong and learn how they actually do work.

How is it that everyone else seems to understand these concepts?  Have you even
begun to think that maybe... just maybe... you are doing something wrong?  And
this has nothing to do with learning methods, this has to do with LISTENING and
UNDERSTANDING what people say.  Your learning level is on par with a 3-year
old, right now.  
********************************

Let me illustrate this for you better:

The functions X and SET-X share a single BINDING.

Let us repeat that:

The functions X and SET-X share a single BINDING.

Do you notice the word BINDING?

BINDING BINDING BINDING BINDING BINDING (5 times, hopefully enough)

That BINDING is named by the variable X.

X is BOUND to 1, initially.

X  ----->  1

Calling (X) returns the value of evaluating that variable binding, giving you
1.

Calling (SET-X 2) modifies the binding of X so that it now is BOUND to 2.

X  ----->  2

Now, calling (X) returns the value of evaluating the variable binding named X.
Can you guess what happens?

I better spell it out: it returns 2.

Stop futzing with continuations, and get your easy semantics down pat first.
You are trying to do calculus without being able to add, much less anything
else.

--
; Matthew Danish <mdan...@andrew.cmu.edu>
; OpenPGP public key: C24B6010 on keyring.debian.org
; Signed or encrypted mail welcome.
; "There is no dark side of the moon really; matter of fact, it's all dark."


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kenny Tilton  
View profile  
 More options May 2 2003, 10:31 pm
Newsgroups: comp.lang.lisp
From: Kenny Tilton <ktil...@nyc.rr.com>
Date: Sat, 03 May 2003 02:26:22 GMT
Local: Fri, May 2 2003 10:26 pm
Subject: Re: Implementation Favoritism, a question of Lisp mindsets

Mark Conrad wrote:
> I can see now why there are so few new newbies adopting CL as their
> preferred language, when it is apparent how cantankerous and downright
> ornery people are in this NG.

The word you are looking for is "savages".

--

  kenny tilton
  clinisys, inc
  http://www.tilton-technology.com/
  ---------------------------------------------------------------
"Everything is a cell." -- Alan Kay


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Conrad  
View profile  
 More options May 2 2003, 10:39 pm
Newsgroups: comp.lang.lisp
From: Mark Conrad <nos...@iam.invalid>
Date: Sat, 03 May 2003 02:37:40 GMT
Local: Fri, May 2 2003 10:37 pm
Subject: Re: Implementation Favoritism, a question of Lisp mindsets
In article <u7k7d8hqe8....@snapdragon.csl.sri.com>, Fred Gilham

<gil...@snapdragon.csl.sri.com> wrote:
> Backing up a little, Mark wrote:

...lotsa stuff, some of it wrong...

Now why can't everyone in this NG be as non-judgemental as you are.

Very fine post you crafted, gentle nudges and suggestions, makes me
actually enjoy learning this CL stuff.

Up until Gareth's post, I used to think both these terms meant the same
thing.

   "The binding of x is 5"

   "The value of x is 5"

I completely missed the distinctions between the terms while reading
about closures in my books, and the connection between the words
"binding" and "environment", which proved to be my downfall and led to
me making foolish statements about how the cookie crumbled.

Gareth came to my rescue, explaining that "binding" and "value" are two
seperate and completely different things.

Once I was alerted to that, everything else fell into place.

Before today I could not spell "expert".

Now I are an expert on closures  ;-)

Anyhow, at least now I know a little bit more about them.

About the difference between 'binding' and 'value' -
    In retrospect, I can't believe I was blind-sided by such an obvious
ommission from my store of knowledge.

Wonder what else I have screwy ideas about.

Hmm, time for me to make more rash statements about how I believe the
cookie crumbles.

Wait fellas, wait - I was just kidding.

Mark-


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Conrad  
View profile  
 More options May 2 2003, 10:39 pm
Newsgroups: comp.lang.lisp
From: Mark Conrad <nos...@iam.invalid>
Date: Sat, 03 May 2003 02:37:52 GMT
Local: Fri, May 2 2003 10:37 pm
Subject: Re: Implementation Favoritism, a question of Lisp mindsets
In article <slrnbb5ses.on.Gareth.McCaug...@g.local>, Gareth McCaughan

<Gareth.McCaug...@pobox.com> wrote:
> ...<snipped>...environment consists of the bindings of X and Y.
> Note: the bindings, not the values.

Thank you, thank you, you are the first person who raised my awareness
that there was a  _difference_  between bindings and values.

Oh, I read the prattle in the books about bindings, then more prattle
about values, but  _nothing_  in those books about a binding being
different than a value.

Up until now, I thought that saying "the value of x is 5" was exactly
the same as saying "the binding of x is 5".

Thanks to your post, I now realize that "binding" and "value" are two
seperate and distinct things.

After reading your post, I did some experimenting:

? (let (x) (setq x 5) x)
5

The (x) in the let-form above creates a "binding" for x.
(whatever the heck a "binding" is)

The  (setq x 5)  creates a "value" for x.

To elaborate a bit, let's make a slightly more complicated 'let'

? (let (x  (y  7))  (setq x 5) (list x y))
(5 7)

The (let (x...   in the let-form above creates a "binding" for x.
(whatever the heck a "binding" is)

The  (setq x 5)  creates a "value" for x, a separate operation from
creating the "binding" for x.

The  (y 7)  creates a binding  *and*  a value for y.

Now, thanks to you, and no thanks to the %*#&*!  books, I *finally*
have a clear idea of what a "closure" is.

Back to the book, I gotta find find out what earthly reason there is
for seperating "binding" from "value", other than to confuse newbies.

Needless to say, your post gets saved to my Extremely-Valuable-Posts
file.

Mark-


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Greg Menke  
View profile  
 More options May 2 2003, 10:41 pm
Newsgroups: comp.lang.lisp
From: Greg Menke <gregm-n...@toadmail.com>
Date: 02 May 2003 22:41:14 -0400
Local: Fri, May 2 2003 10:41 pm
Subject: Re: Implementation Favoritism, a question of Lisp mindsets

Mark Conrad <nos...@iam.invalid> writes:
> I don't want to "piss people off" so this will likely be my last post
> in this NG.

> I can see now why there are so few new newbies adopting CL as their
> preferred language, when it is apparent how cantankerous and downright
> ornery people are in this NG.

> Mark-

People in this newsgroup only get cantankerous when a newbie comes
into the group and throws his/her weight around on the strength of
(possibly) wide experience in other languages.  It is necessary for
newbies to be quiet and pay close attention to the language until they
being to understand it from the standpoint of actual, non-trivial use.
Its great to ask questions about the language, but you mustn't presume
to know how the language <should> be.  Common Lisp isn't perfect, but
once you learn it (and by doing so, unlearning and properly relearning
techniques and language characteristics you've long thought cast in
stone), then you'll begin to appreciate how nice it really is.

I think if you spend 6 months really trying to learn Common Lisp, by
writing programs, then you'll find yourself starting to write Lisp in
other languages too.  I didn't really start to perceive some of the
subtlties of C/C++ (such as they are) until I began a serious approach
to Common Lisp.

Gregm


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thien-Thi Nguyen  
View profile  
 More options May 3 2003, 2:00 am
Newsgroups: comp.lang.lisp
From: Thien-Thi Nguyen <t...@glug.org>
Date: 03 May 2003 01:58:14 -0400
Local: Sat, May 3 2003 1:58 am
Subject: Re: Implementation Favoritism, a question of Lisp mindsets

Mark Conrad <nos...@iam.invalid> writes:
> Thanks to your post, I now realize that "binding" and "value" are two
> seperate and distinct things.

but you don't yet understand their relationship:

> After reading your post, I did some experimenting:

> ? (let (x) (setq x 5) x)
> 5

> The (x) in the let-form above creates a "binding" for x.
> (whatever the heck a "binding" is)

> The  (setq x 5)  creates a "value" for x.

binding is sight, and like sight, is constrained by who is looking and
where/when/how/why they look.  value is what is perceived given this
complicated process of looking.

here, `let' creates a small telescope (we are one end, `x' the other),
`setq' moves the telescope.  the 5 has always been there (how could it
not be?); moving the telescope in its direction does not create it.
what is created is our awareness of it, through the `x'.

that is why "the truth is out there" is not a bad approach to
mass-market functional conspiracy programming...  (end lame joke).

thi


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeff Caldwell  
View profile  
 More options May 3 2003, 6:33 am
Newsgroups: comp.lang.lisp
From: Jeff Caldwell <jd...@yahoo.com>
Date: Sat, 03 May 2003 10:33:40 GMT
Local: Sat, May 3 2003 6:33 am
Subject: Re: Implementation Favoritism, a question of Lisp mindsets
Wow... the Zen of let.

Thien-Thi Nguyen wrote:

...

> `let' creates (a way to see)*

 > ... the 5 has always been there
 > (how could it not be)?
 >  moving ... does not create it.

> what is created is our awareness

* - changed from 'a telescope' for ... well, for poetic purposes

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pascal Costanza  
View profile  
 More options May 3 2003, 6:44 am
Newsgroups: comp.lang.lisp
From: Pascal Costanza <costa...@web.de>
Date: Sat, 03 May 2003 12:44:29 +0200
Local: Sat, May 3 2003 6:44 am
Subject: Re: Implementation Favoritism, a question of Lisp mindsets
In article <020520031940504126%nos...@iam.invalid>,
 Mark Conrad <nos...@iam.invalid> wrote:

> > ...<snipped>...environment consists of the bindings of X and Y.
> > Note: the bindings, not the values.

> Thank you, thank you, you are the first person who raised my awareness
> that there was a  _difference_  between bindings and values.

> Oh, I read the prattle in the books about bindings, then more prattle
> about values, but  _nothing_  in those books about a binding being
> different than a value.

See for example the entry for binding in the glossary section of the
HyperSpec:

binding n. an association between a name and that which the name
denotes. ``A lexical binding is a lexical association between a name and
its value.'' When the term binding is qualified by the name of a
namespace , such as ``variable'' or ``function,'' it restricts the
binding to the indicated namespace, as in: `` let establishes variable
bindings.'' or `` let establishes bindings of variables.''

There are goods books for beginners out there, some for free, that
explain theses things. For example, take a look at http://psg.com/~dlamkins/sl/cover.html

Pascal


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marc Spitzer  
View profile  
 More options May 3 2003, 7:37 am
Newsgroups: comp.lang.lisp
From: Marc Spitzer <mspit...@optonline.net>
Date: Sat, 03 May 2003 11:37:30 GMT
Local: Sat, May 3 2003 7:37 am
Subject: Re: Implementation Favoritism, a question of Lisp mindsets

Kenny Tilton <ktil...@nyc.rr.com> writes:
> Mark Conrad wrote:
> > I can see now why there are so few new newbies adopting CL as their
> > preferred language, when it is apparent how cantankerous and downright
> > ornery people are in this NG.

> The word you are looking for is "savages".

So he is the missionary? To the rest of the savages "Soups on"

marc


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Conrad  
View profile  
 More options May 3 2003, 9:09 am
Newsgroups: comp.lang.lisp
From: Mark Conrad <nos...@iam.invalid>
Date: Sat, 03 May 2003 13:07:45 GMT
Local: Sat, May 3 2003 9:07 am
Subject: Re: Implementation Favoritism, a question of Lisp mindsets
In article <costanza-6A0E31.12442903052...@news.netcologne.de>, Pascal

Costanza <costa...@web.de> wrote:
> See for example the entry for binding in the glossary section of the
> HyperSpec:

> binding n. an association between a name and that which the name
> denotes. ``A lexical binding is a lexical association between a name and
> its value.'' When the term binding is qualified by the name of a
> namespace , such as ``variable'' or ``function,'' it restricts the
> binding to the indicated namespace, as in: `` let establishes variable
> bindings.'' or `` let establishes bindings of variables.''

Specifically:

> '' When the term binding is qualified by the name of a
> namespace , such as ``variable'' or ``function,'' it restricts the
> binding to the indicated namespace, as in: `` let establishes variable
> bindings.'' or `` let establishes bindings of variables.''

Is that all in the heck "binding" means.  Cheez!

And I thought there was much more that "binding" meant, that influenced
exactly how the variable would act in a program.

Now I see why the great majority of my Lisp books don't even mention
"binding" in the index.

Okay, if I FINALLY understand binding correctly, the 'let' form below
does *not* establish a binding between x and anything else!

? (let (x) x    'lexical-variable-x-is-not-bound-to-anything)
LEXICAL-VARIABLE-X-IS-NOT-BOUND-TO-ANYTHING

Likewise:
    (defvar k)

The special variable k is not bound to anything either.

All the lousy defvar does is make a promise to the compiler, a
'declaration' to the compiler, (and to anyone who reads my code), that
eventually a 'special' binding to k  _will_  be created, if and when I
get around to using setq to create the binding.

Likewise:
   When one uses the word "binding" when describing closures -

...as in "In the closure k below, lexical variable x is bound to the
value BIG, and lexical variable y is bound to the value DADDY"

I am right back where I started a week ago, when I said there was no
difference between saying:

     " X is 'bound' to the value BIG "

             - - or - -

       " The value of  X is BIG "

Okay, here is the closure k that I have been talking about:

(defvar k)

(let ((x  'big) (y  'daddy))
    (setq k  #'(lambda () (list x y) )))

? (funcall k)
(BIG DADDY)

Now, where is that guy who made a statement a few days ago to the
effect that a closure preserves the bindings, not the values.

To me they seem to be essentially the same thing.

Wonder what he meant?

Oh well, twenty years from now I will figure it all out.

FWIW,  all SICP had about bindings was a general statement on page 184
that bindings associated values with variables.

Mark-


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Conrad  
View profile  
 More options May 3 2003, 9:33 am
Newsgroups: comp.lang.lisp
From: Mark Conrad <nos...@iam.invalid>
Date: Sat, 03 May 2003 13:31:57 GMT
Local: Sat, May 3 2003 9:31 am
Subject: Re: Implementation Favoritism, a question of Lisp mindsets
In article <7gwuh87ert....@gnufans.net>, Thien-Thi Nguyen

<t...@glug.org> wrote:
Mark Conrad wrote:
> > After reading your post, I did some experimenting:

> > ? (let (x) (setq x 5) x)
> > 5

> > The (x) in the let-form above creates a "binding" for x.
> > (whatever the heck a "binding" is)

> > The  (setq x 5)  creates a "value" for x.

The example code above was a very bad example, I did not realize that
the 'let' form assigned a default value of NIL to x.

Mark Conrad wrote this to Gareth McCaughan:

> > Thanks to your post, I now realize that "binding" and "value" are two
> > seperate and distinct things.

Thien-Thi Nguyen observed:

> but you don't yet understand their relationship

You are correct.  As of right now I am leaning towards "binding" and
"value" as meaning essentially the same thing, as in:

       "The lexical binding of x is 5"

       "The value of x is 5"

..."binding" could get across a little more information, like whether
the variable x is lexically-scoped or dynamically-scoped.

I have a bunch of good Lisp books, but they don't go into detail about
whether or not there are any more differences between "binding" and
"value".

Mark-


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pascal Costanza  
View profile  
 More options May 3 2003, 9:34 am
Newsgroups: comp.lang.lisp
From: Pascal Costanza <costa...@web.de>
Date: Sat, 03 May 2003 15:34:38 +0200
Local: Sat, May 3 2003 9:34 am
Subject: Re: Implementation Favoritism, a question of Lisp mindsets
In article <030520030610101628%nos...@iam.invalid>,
 Mark Conrad <nos...@iam.invalid> wrote:

Try the following:

(defvar k)
(defvar setx)
(defvar sety)

(let ((x 'big) (y 'daddy))
  (setq k #'(lambda () (list x y)))
  (setq setx #'(lambda (value) (setq x value)))
  (setq sety #'(lambda (value) (setq y value))))

? (funcall k)
(big daddy)

? (funcall sety 'mummy)
mummy

Try to guess what (funcall k) will print now.

And PLEASE: It's not very constructive that you don't follow the links
people provide to you. See http://www.psg.com/~dlamkins/sl/contents.html, especially lessons 5 and 6.

Do it! Do it now! Take some time to read and understand these things.
There are over 30 chapters in that book. You don't want to post that
much as you do on every single topic, right?

Pascal


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jens Axel Søgaard  
View profile  
 More options May 3 2003, 9:36 am
Newsgroups: comp.lang.lisp
From: Jens Axel Søgaard <use...@jasoegaard.dk>
Date: Sat, 03 May 2003 15:34:32 +0200
Local: Sat, May 3 2003 9:34 am
Subject: Re: Implementation Favoritism, a question of Lisp mindsets

Mark Conrad wrote:
> FWIW,  all SICP had about bindings was a general statement on page 184
> that bindings associated values with variables.

Well, how much did you read of the first two chapters?

In this section the withdraw is a closure.

[note: (define (withdraw amount) ...) is sugar for
        (define withdraw (lambda (amount) ...)) ]

<http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-20.html>

The pedagogy of the book is to show you how things work first,
and then later in great detail explain the evaluation model.

--
Jens Axel Søgaard


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 201 - 225 of 262 < Older  Newer >
« Back to Discussions « Newer topic     Older topic »