|
What's the difference between:
(cons 'a (cons 'b 'c)) ;; (A B . C)
and
(cons 'a '(b.c)) ;; (A B.C)
I need to create the following list ((a.b).c) using cons so i'm trying to understand what that "." represents.
L.E. : I have the following (cons (cons '...
Started by daniels on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
(cons 'b 'c) creates a cons cell with the symbol b as the car....
Note the space around.
Is used to separate the CAR and the CDR of a cons cell: (a .
Will read it as a cons cell with FOO as the CAR and BAR as the CDR.
|
|
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.
|
Ask your Facebook Friends
|
What's the pros and cons of using a Model-View-Controller model in building your application?
Started by RCIX on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Pros
No business logic in UI More Unit Testable One size fits all solution (Well Almost..) Cons.
|
|
What are the differences(pros/cons) between clustered and non-clustered indexes?
Started by Eric Labashosky on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
Cons:
Clustered indexes are can slow down inserts because the physical layouts of the records.
Statement.
|
|
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.
|
|
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 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.
|
|
What cons of Oracle can you find?
Started by Simon on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
If you're interfacing with Open....
Big buck paying companies usually keep full time Oracle admins on staff .
Oracle is not simple to configure.
But Oracle for bigger users becomes EXPENSIVE quickly.
Oracle for private/small-time use is free.
It's expensive.
|
|
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....
|