Re: what's the meaning of "car","cdr","cons" in tree's algorithm?
From: Anders Eriksson (anders.eriksson_at_morateknikutveckling.se)
Date: 04/20/04
- Next message: andy: "VC7.1 - put debug info in .exe not .pdb"
- Previous message: David Webber: "Re: Is there a way to recall a constructor function of an already existing class object?"
- In reply to: hostran: "what's the meaning of "car","cdr","cons" in tree's algorithm?"
- Next in thread: hostran: "Re: what's the meaning of "car","cdr","cons" in tree's algorithm?"
- Reply: hostran: "Re: what's the meaning of "car","cdr","cons" in tree's algorithm?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 20 Apr 2004 11:37:46 +0200
Hello!
On Tue, 20 Apr 2004 17:06:12 +0800, hostran wrote:
<snip>
> there is "/* address of <car> */" & "/* address of <cdr> */" , but I don't
> know what's the meanning of "car" , "cdr" & "cons"?
>
Whoa, a flashback from the days when I programmed in Lisp!
You can read more about this here:
http://www.delorie.com/gnu/docs/elisp-manual-21/elisp_25.html
To summarize (since I don't know exactly how the tree is created this is my
guess): cons is a struct that contains two pointer, The first pointer is
called 'car' and points to a cons on the left side of the tree and the
second pointer is called 'cdr' and points to a cons on the right side of
the tree.
(left and right side may be switched)
// Anders
- Next message: andy: "VC7.1 - put debug info in .exe not .pdb"
- Previous message: David Webber: "Re: Is there a way to recall a constructor function of an already existing class object?"
- In reply to: hostran: "what's the meaning of "car","cdr","cons" in tree's algorithm?"
- Next in thread: hostran: "Re: what's the meaning of "car","cdr","cons" in tree's algorithm?"
- Reply: hostran: "Re: what's the meaning of "car","cdr","cons" in tree's algorithm?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|