Search found 21 matches

by joybee
Tue Dec 07, 2010 11:04 am
Forum: The Lounge
Topic: How can I get file modification time?
Replies: 1
Views: 6127

How can I get file modification time?

Can anyone help me with this question?

Thanks!
by joybee
Wed Sep 01, 2010 10:10 am
Forum: The Lounge
Topic: Can anyone explain the lambda expression to me?
Replies: 2
Views: 7242

Can anyone explain the lambda expression to me?

:cry:

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!
by joybee
Fri Aug 27, 2010 10:18 am
Forum: The Lounge
Topic: Another question about associate list
Replies: 5
Views: 13388

Re: Another question about associate list

The varlist is the same structure as mylist.
by joybee
Fri Aug 27, 2010 10:17 am
Forum: The Lounge
Topic: How to reset the value of associate list element
Replies: 9
Views: 17591

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?
by joybee
Thu Aug 26, 2010 12:33 pm
Forum: The Lounge
Topic: Another question about associate list
Replies: 5
Views: 13388

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...
by joybee
Thu Aug 26, 2010 10:44 am
Forum: The Lounge
Topic: How to reset the value of associate list element
Replies: 9
Views: 17591

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!!
by joybee
Sat Jul 31, 2010 6:39 am
Forum: Common Lisp
Topic: format string left alignment
Replies: 2
Views: 3470

Re: format string left alignment

That's not what I wanted!!!


Good grief!
by joybee
Sat Jul 31, 2010 6:37 am
Forum: Common Lisp
Topic: format string left alignment
Replies: 2
Views: 3470

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
by joybee
Mon Jul 19, 2010 3:05 pm
Forum: The Lounge
Topic: What's wrong with this code?
Replies: 3
Views: 7634

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.
by joybee
Fri Jul 16, 2010 2:36 pm
Forum: The Lounge
Topic: What's wrong with this code?
Replies: 3
Views: 7634

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)))
)
)