Search found 209 matches

by Jasper
Wed Oct 22, 2008 6:26 pm
Forum: Common Lisp
Topic: Why aren't these equivalent?
Replies: 2
Views: 7531

Re: Why aren't these equivalent?

Code: Select all

(do ((i 0 (+ i 1)) (list nil (cons list i)) ((= i 10) list))
(do ((i 0) (list nil (cons list i)) ((= i 10) list) (setf i (+ i 1))
Compare those. the 'do body is done before the 'increment' operations.
by Jasper
Wed Oct 15, 2008 11:06 am
Forum: Common Lisp
Topic: Tree expression shortener; seperator
Replies: 10
Views: 29794

Re: Tree expression shortener; seperator

Ok, i have been using lisp for a while, and have already 'embraced the parentheses'. I like the high level of whitespace in well indented with the syntax attractive. And if used well, it is very clear. And if done badly it will look bad, just like parentheses alone. Imo the only point of the code is...
by Jasper
Tue Oct 14, 2008 6:13 pm
Forum: Common Lisp
Topic: Tree expression shortener; seperator
Replies: 10
Views: 29794

Re: Tree expression shortener; seperator

@qbg: I agree with you there. But in a way, the changed code can look cleaner, although it is less clean for having more syntax. It saves n+1 characters for a list with only lists as elements. The adding of syntax, and decreasing sight of the tree are the issues here afaik. I think it can make the c...
by Jasper
Mon Oct 13, 2008 9:11 am
Forum: Common Lisp
Topic: Efficiency, Delayed Computation and Lambda
Replies: 3
Views: 8840

Re: Efficiency, Delayed Computation and Lambda

Why not just (defmethod draw-object ((object its-type) (layer fixnum) (env environment)...) Then you can make passes for each layer and objects can write to layers as they wish. You might of course also optimize to avoid some of the layers objects that do not draw to many layers, using an array for ...
by Jasper
Mon Oct 13, 2008 3:25 am
Forum: Common Lisp
Topic: Tree expression shortener; seperator
Replies: 10
Views: 29794

Re: Tree expression shortener; seperator

You need to look better. Or count the hooks, 's and 'b 's. Note that s <-> ; and b <-> | its just that ; and | dont make good symbols. (Well, |;|) Or look at the code i changed with it. The lack of many hooks.
by Jasper
Sun Oct 12, 2008 11:37 pm
Forum: Common Lisp
Topic: Tree expression shortener; seperator
Replies: 10
Views: 29794

Tree expression shortener; seperator

It could be possible to save a character per sublist: use a symbol as separator. I will use a seperator ';' and '|' as a blocker of separated sublisting. (Although they wouldnt work for common lisp since they are already used.) If you read in the blocker and separator as symbols, you can make them w...
by Jasper
Sun Oct 12, 2008 10:29 pm
Forum: Common Lisp
Topic: Discussion on possible lambda syntax: Good or Evil?
Replies: 17
Views: 33754

Re: Discussion on possible lambda syntax: Good or Evil?

I don't like any of them very well, but the one with the dollar signs the best. See no particular reason to use $1 ,etc and not $any-symbol. I admit have not giving it that much thought. About needing to move dollar signs, if it is longer code, the (lambda(blabla) body) would be small relative to th...
by Jasper
Fri Oct 10, 2008 9:13 am
Forum: Common Lisp
Topic: Lisp, Windows and OpenGL
Replies: 8
Views: 20609

Re: Lisp, Windows and OpenGL

I use cl-sdl and cl-opengl together, that works, on ubuntu at least. That doesn't give you anything to make UI widgets with, though. GLUTs keyboard and mouse input is just plain limited, afaik. I remember using it in c(++?) and just hitting walls, but forgot what the limitations were. I wouldn't use...
by Jasper
Fri Oct 10, 2008 8:56 am
Forum: Common Lisp
Topic: Beginner question
Replies: 4
Views: 10201

Re: Beginner question

Are you sure they don't mean the string "yyyymmdd" then you can use subseq . (defun year(str) (read-from-string(subseq str 0 4))) (defun month(str) (read-from-string(subseq str 4 6))) (defun day(str)(read-from-string(subseq str 6 8))) Of course, it assumes the string is long enough. Hmm, i...