Search found 30 matches
- Sat Nov 17, 2012 11:35 am
- Forum: Common Lisp
- Topic: on &rest and keyword args...
- Replies: 11
- Views: 26737
on &rest and keyword args...
HI I have problems with keyword and rest arguments mixing… For example, if we have the following func: (defun arguments (&rest args &key (a 4) (b 5) (c 6)) (list args a b c)) ; then I call: (arguments) (NIL 4 5 6) ; and it’s ok , as I expected… now if I call func with follow args: (arg...
- Sat Nov 10, 2012 12:02 pm
- Forum: Common Lisp
- Topic: on function...
- Replies: 2
- Views: 6408
Re: on function...
Thank Ramarren for explanation !!
- Sat Nov 10, 2012 10:44 am
- Forum: Common Lisp
- Topic: on function...
- Replies: 2
- Views: 6408
on function...
HI It seems that I still have some doubt on ‘ function ’ operator.. For example some code that I’m learning on the book (and also on the web)use it with lambda : In compose definition: (defun compose (&rest fns) (destructuring-bind (fnl . rest) (reverse fns) #'(lambda (&rest args) (red...
- Fri Nov 09, 2012 8:31 am
- Forum: Common Lisp
- Topic: query on closure...
- Replies: 2
- Views: 5329
Re: query on closure...
ohh good
thanks for explanation
thanks for explanation
- Fri Nov 09, 2012 5:56 am
- Forum: Common Lisp
- Topic: query on closure...
- Replies: 2
- Views: 5329
query on closure...
HI in the book Graham says about closure : """When a function refers to a variable defined outside it, it's called a free variable. A function that refers to a free lexical variable is called a closure The variable must persist as long as the function does.""" and after...
- Mon Nov 05, 2012 1:18 pm
- Forum: Common Lisp
- Topic: end chapter exercise's doubts...
- Replies: 7
- Views: 14216
Re: end chapter exercise's doubts...
Hi and thanks very much guys for good explanations!!!
eventually I continue to make the same mistake!! uffff : I forget that it’s possible initialize a variable without value, then take nil to default…
like compare-to result backref in wvxvw's code ..
thanks again!!!
eventually I continue to make the same mistake!! uffff : I forget that it’s possible initialize a variable without value, then take nil to default…
like compare-to result backref in wvxvw's code ..
thanks again!!!
- Mon Nov 05, 2012 5:37 am
- Forum: Common Lisp
- Topic: end chapter exercise's doubts...
- Replies: 7
- Views: 14216
Re: end chapter exercise's doubts...
HI Paul , wvxvw and stackman ...thanks for your support and suggestions!! ;) Now I have some questions for wvxvw about his syntax's code that are new for me :roll: First: ---- the third, fourth and fifth expressions in the fisrt “ do†’s argument : compare-to result backref will be evaluated a...
- Sun Nov 04, 2012 1:05 pm
- Forum: Common Lisp
- Topic: end chapter exercise's doubts...
- Replies: 7
- Views: 14216
end chapter exercise's doubts...
HI the exercise says: """Define iterative and recursive versions of a function that takes an object x and vector v, and returns a list of all the objects that immediately precede x in v: > (precedes #\a "abracadabra") (#\c #\d #\r) """ ok, my solution (iterati...
- Sat Oct 27, 2012 1:29 am
- Forum: Common Lisp
- Topic: element-type in array..
- Replies: 3
- Views: 6127
Re: element-type in array..
opss'!!!
perfect thanks!
perfect thanks!
- Fri Oct 26, 2012 1:05 pm
- Forum: Common Lisp
- Topic: element-type in array..
- Replies: 3
- Views: 6127
element-type in array..
HI If I try to make a resizable string with make-array , but error raises with vector-push ..: (defparameter str (make-array 10 :fill-pointer 0 :adjustable t :element-type 'character)) >STR (vector-push 'a' str) ;;error raise: value STR is not of the expected type (AND ARRAY (SATISFIES ARRAY-HAS-FIL...