|
What exactly is the definition of a Common Lisp Cons Cell? How is a Cons Cell different than a standard linked list item? After all, both the cons cell and the linked list item have a value and a pointer to the next cell or item... or is this understanding...
Started by Jonas Gorauskas on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
A cons, which can be nil, atoms, or other....
General usage of course is to point to a "value" with the left one, and to another Cons cell (or nil) with the "right" one.
Cons cells in general hold two pointers that can point to anything.
|
|
I realize this is a total n00b question, but I'm curious and I thought I might get a better explanation here than anywhere else. Here's a list (I'm using Dr. Scheme)
> (list 1 2 3) (1 2 3)
Which I think is just sugar for this:
> (cons 1 (cons 2 ...
Started by dsimard on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Cons2 (cons 3 null) => (2, 3)
The last example you gave cons 2 3 does not conform to this list definition so its....
cons 3 null => (3) 3.
Null => () --read as empty list 2.
Of an item cons a list
So these are lists:
1.
|
|
Before I attempt to "re-create the wheel" I was wondering if anyone knows if a master list of CONs already exists?
If there is, perhaps someone would be willing to point me in that direction?
If not, I thought this might be a great place for us to start...
Started by Kelly B on
, 6 posts
by 5 people.
Answer Snippets (Read the full thread at peginc):
There's a big list of cons down the right....
I'll work today.
The e-zine Savage Insider features a list of cons coming up in the next few months in each issue - The Fink Good day, Duck!
The ones that I know of are mostly mid-west Cons.
|
Ask your Facebook Friends
|
I wonder why in the following code, d is not being cons ed into x . Any hints are much appreciated.
(defun it (x) (setq f '(a b c)) (dolist (d f) (cons d x)) (print x))
Thank you!
Started by TrueStar on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
(cons d x) doesn't change anything; it creates (if (listp x) x (list x)) '(a ....
If x is a list, then (cons d x) will also be a list.
I don't know a lot about LISP, but here's a few things I think I know that might help you:
(cons d.
|
|
What are the pros and cons of giving SQL's service account administrator privileges?
Started by SuperCoolMoss on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at serverfault):
Pro: full access to the local system
Con: full access.
Service accounts to the least privilege.
|
|
What are cons to use % over em in terms of accessibility?
Started by jitendra on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
This led to the recommendation to stay away from pixels in order to allow users to view... .
In the olden days, internet explorer wouldn't let you zoom a page if sizes were specified in pixels, but would if in em or % .
I don't think there are any any more.
|
|
Are there ruby equivalents to the lisp car, cdr, and cons functions? For those unfamiliar with lisp, here's what I want from ruby:
[1,2,3].car => 1 [1,2,3].cdr => [2,3] [2,3].cons(1) => [1,2,3]
(in lisp):
(car '(1 2 3)) => 1 (cdr '(1 2 3))...
Started by Bee on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
Def inspect "lnil" end def cons(car) Cell.new(car, self) end def list? true end end LispNil) if elements.empty? LispNil else first, *rest = elements Cell.new(first, list(*rest)) end end def cons(new_car #=> 1 notlist.cdr #=> 2 notlist....
|
|
Just wondering what the pros and cons of a TreeSet is, if anyone could tell me please? Thanks!
Started by Rifk on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Cons: One.
Cons: value must either be Comparable or you need to provide Comparator in the constructor, TreeSet requires a Comparable implementation on the item class to define the natural order.
For operations.
|
|
I'm begining a new webapp in Python. I've narrowed my choices down to Django and Pylons. What are the pros/cons of each?
Started by minty on
, 13 posts
by 13 people.
Answer Snippets (Read the full thread at stackoverflow):
Django vs Pylons:
http://versus.bix.yahoo.com/vs/Django-vs-Pylons
http://pydanny.blogspot.com/2007/11/pylons-vs-django.html
http://carefulweb.com/blog/2008/08/11/django-vs-pylons-development-and-deployment/
How experienced are you in Python? If the answer... .
|
|
What are the pros and cons of pros and cons of predictive models and adaptive models?
Answer Snippets (Read the full thread at answers):
|