Search found 94 matches

by smithzv
Sun Jun 24, 2012 4:04 pm
Forum: User Groups and Conferences
Topic: User Group in Chicago
Replies: 4
Views: 38600

Re: User Group in Chicago

That's great. I clearly don't check this forum very often :oops: . Too bad something isn't something already established. I am okay with meeting downtown. I guess if there is only the two of us, meeting up will just be us showing each other what we have been working on lately. What dialects do you u...
by smithzv
Sun Jun 24, 2012 3:16 pm
Forum: Common Lisp
Topic: Anybody interested in teaming up for the ICFP Contest?
Replies: 2
Views: 7336

Anybody interested in teaming up for the ICFP Contest?

I have been competing in the ICFP Contest for the last 5 years or so and will do so again this year. The contest begins in 3 weeks, it starts on July 13 at 12:00 UTC and will continue until July 16 at 12:00 UTC. For those that don't know, the ICFP Contest ( https://icfpcontest2012.wordpress.com/ ) i...
by smithzv
Thu Dec 15, 2011 8:18 am
Forum: Common Lisp
Topic: Implementing "last" with do*
Replies: 19
Views: 24617

Re: Implementing "last" with do*

Well, actually, BUTLAST has an optional 2nd argument that lets you say "but the last n elements". Be that as it may, this solutions is actually just incorrect. It relies on the assumption that all elements in the list are unique. SET-DIFFERENCE is for taking the difference between two math...
by smithzv
Wed Dec 14, 2011 9:41 am
Forum: Common Lisp
Topic: Recursive Version of let?
Replies: 5
Views: 7164

Re: Recursive Version of let?

An aside, I suppose a "recursive let" (interpreted the same way labels allows for recursive functions) would mean I could do something like: (let ((phi (+ 1 (/ phi)))) phi) which would bind phi here to the golden ratio. In order to write this macro, you would have to be able to solve arbit...
by smithzv
Wed Dec 14, 2011 12:38 am
Forum: Common Lisp
Topic: Recursive Version of let?
Replies: 5
Views: 7164

Re: Recursive Version of let?

let* is what you are looking for. But it really isn't exactly analogous to flet and labels. The bindings happen in the order specified.
by smithzv
Sun Dec 11, 2011 12:44 pm
Forum: Common Lisp
Topic: Implementing "last" with do*
Replies: 19
Views: 24617

Re: Implementing "last" with do*

It's the same as Konfusius' except now 1->n, which was the hint he was giving you.
by smithzv
Sun Dec 11, 2011 7:04 am
Forum: Common Lisp
Topic: Implementing "last" with do*
Replies: 19
Views: 24617

Re: Implementing "last" with do*

List isn't a keyword, but it does happen to be the name of a common function. But call your variables what you wish. I think you are confused on how the equality operators work. EQ is more like "checking pointers" and it might not work. EQL and above (EQUAL and EQUALP) would all work for t...
by smithzv
Sun Dec 11, 2011 6:27 am
Forum: Common Lisp
Topic: Implementing "last" with do*
Replies: 19
Views: 24617

Re: Implementing "last" with do*

1) I don't have any idea if I can declare this variable ** inside the function and WHERE. Hopefully you have heard of binding variables. If not, check out LET. It allows you to define a variable. You don't even have to use LET in this case, because DO basically has a LET built in. As for the base c...
by smithzv
Sun Dec 11, 2011 5:23 am
Forum: Common Lisp
Topic: Implementing "last" with do*
Replies: 19
Views: 24617

Re: Implementing "last" with do*

Yes and no. I am perhaps spoiling the pedagogy here (which I take is the essence of the exercise), but just so we're clear, I talking about instead of computing the length of the list and then seeing it equals 1, just checking the CDR of the list to see if it is NIL (which works out to be the same)....
by smithzv
Sat Dec 10, 2011 9:56 pm
Forum: Common Lisp
Topic: Implementing "last" with do*
Replies: 19
Views: 24617

Re: Implementing "last" with do*

Right but there are different ways to write the same en condition. For instance, you could also write: ((equal 1 (list-length lista)) ;; <== when there is just one element left ==> stop although it would have the same behavior. There is a way to write that exit condition so that it takes a constant ...