Can anyone help me with this question?
Thanks!
Search found 21 matches
- Tue Dec 07, 2010 11:04 am
- Forum: The Lounge
- Topic: How can I get file modification time?
- Replies: 1
- Views: 6708
- Wed Sep 01, 2010 10:10 am
- Forum: The Lounge
- Topic: Can anyone explain the lambda expression to me?
- Replies: 2
- Views: 8286
Can anyone explain the lambda expression to me?

I just couldn't get it. Here is a simple example and it complains about illegal lambda expression (unknown lisp) or illegal function call (sbcl).
(defvar a 3)
(defvar b 5)
(if (not (equal a b)) ((format t "not equal~%") (setq a 6) (setq b 10)))
Thanks!
- Fri Aug 27, 2010 10:18 am
- Forum: The Lounge
- Topic: Another question about associate list
- Replies: 5
- Views: 14647
Re: Another question about associate list
The varlist is the same structure as mylist.
- Fri Aug 27, 2010 10:17 am
- Forum: The Lounge
- Topic: How to reset the value of associate list element
- Replies: 9
- Views: 20718
Re: How to reset the value of associate list element
Thanks, everyone!
Here is a little example I ran on sbcl.
* (equal (list 1 2) (rplacd (list 1 1) 2))
* NIL
* (rplacd (list 1 1) 2)
* (1 . 2)
What I want is after value reset the evaluation of equal returns T. How can I achive that?
Here is a little example I ran on sbcl.
* (equal (list 1 2) (rplacd (list 1 1) 2))
* NIL
* (rplacd (list 1 1) 2)
* (1 . 2)
What I want is after value reset the evaluation of equal returns T. How can I achive that?
- Thu Aug 26, 2010 12:33 pm
- Forum: The Lounge
- Topic: Another question about associate list
- Replies: 5
- Views: 14647
Another question about associate list
I have create an associate list mylist (list (list :a a) (list :b b) (list :c c)) later I need to check if the list contains an entry which has same value as a variable specified and if it does, then I want to delete the entry. First I used member and it returned nil, why? (dolist (myvar varlist) (i...
- Thu Aug 26, 2010 10:44 am
- Forum: The Lounge
- Topic: How to reset the value of associate list element
- Replies: 9
- Views: 20718
How to reset the value of associate list element
If I have a associate list ((:a a) (:b b) (:c c)), how can I set b to (:b z)?
Can you tell me different ways to do it?
Thanks!!
Can you tell me different ways to do it?
Thanks!!
- Sat Jul 31, 2010 6:39 am
- Forum: Common Lisp
- Topic: format string left alignment
- Replies: 2
- Views: 3742
Re: format string left alignment
That's not what I wanted!!!
Good grief!
Good grief!
- Sat Jul 31, 2010 6:37 am
- Forum: Common Lisp
- Topic: format string left alignment
- Replies: 2
- Views: 3742
format string left alignment
Hello! Can anyone help me? I don't know how to format string outputs so each column would be aligned up. Right now my output looks ugly. I used ~t to space out but it didn't seem to work. What I want will look like: abcdefg heck dseg I don't know how to do it hello, there Good grief
- Mon Jul 19, 2010 3:05 pm
- Forum: The Lounge
- Topic: What's wrong with this code?
- Replies: 3
- Views: 12536
Re: What's wrong with this code?
Thanks, Calibraxis,
I knew the code you gave to me is working. But I can't use "loop for/with " style. When I tried my code, sbcl complained about illegal function call at the setf line and I have no idea why.
I knew the code you gave to me is working. But I can't use "loop for/with " style. When I tried my code, sbcl complained about illegal function call at the setf line and I have no idea why.
- Fri Jul 16, 2010 2:36 pm
- Forum: The Lounge
- Topic: What's wrong with this code?
- Replies: 3
- Views: 12536
What's wrong with this code?
(defun string-split (split-pattern string)
(let ((n 0) (l (length split-pattern)))
(loop
(setf pos (search split-pattern string :start2 n))
(if pos ((collect (subseq string n pos)) (setf n (+ pos l)))
)
(collect (subseq string n)))
)
)
(let ((n 0) (l (length split-pattern)))
(loop
(setf pos (search split-pattern string :start2 n))
(if pos ((collect (subseq string n pos)) (setf n (+ pos l)))
)
(collect (subseq string n)))
)
)