Search found 148 matches

by Paul Donnelly
Mon Jul 20, 2009 8:15 pm
Forum: Common Lisp
Topic: Experience of Learning Lisp
Replies: 52
Views: 1992039

Re: Experience of Learning Lisp

I don't really see them as statements of fact, I see them as questions. "Is this a hash table?" is the question, and the answer is true or false. But that's exactly the problem. “Is this a hash table,” is a question, and can't possiblly be true or false. To be true or false, you have ...
by Paul Donnelly
Mon Jul 20, 2009 1:42 pm
Forum: Common Lisp
Topic: Experience of Learning Lisp
Replies: 52
Views: 1992039

Re: Experience of Learning Lisp

I think some of the naming conventions are better; you don't have to remember if it's SOMETHINGP or SOME-THING-P, it's always "something?". So you just have to remember to use a question mark to denote statements of fact. :? And have to disambiguate it when speaking, unless you consider s...
by Paul Donnelly
Sat Jul 18, 2009 3:48 pm
Forum: Common Lisp
Topic: Experience of Learning Lisp
Replies: 52
Views: 1992039

Re: Experience of Learning Lisp

CL-USER> (listp (cons 1 2)) T CL-USER> (list-length (cons 1 2)) ; Evaluation aborted. ; The value 2 is not of type LIST. ; [Condition of type TYPE-ERROR] What's inconsistent about not being able to take the length of improper lists? I don't even know why a person would try to do this intentionally,...
by Paul Donnelly
Fri Jul 17, 2009 9:47 am
Forum: Common Lisp
Topic: Experience of Learning Lisp
Replies: 52
Views: 1992039

Re: Experience of Learning Lisp

I appreciate the logical hierarchy and organization imposed on methods in an OO design. (Before I get too far, I am aware that Lisp supports objects, but what I'm addressing here is the large quantity of functions in the language spec that would be much more comprehensible and easier to learn if th...
by Paul Donnelly
Fri Jul 10, 2009 2:54 pm
Forum: Common Lisp
Topic: Style guide
Replies: 5
Views: 11097

Re: Style guide

(with-some-resource foo (bar foo)) (if (foo) (bar) (baz)) (foo (bar) (baz) (quux) (blarg) (something) (else)) IMO. In general, lisp-mode has the right idea. When you make macros that take a body parameter, make sure to use &body so Emacs knows how to indent that portion. The last one, I think, ...
by Paul Donnelly
Tue Jun 30, 2009 4:31 am
Forum: Common Lisp
Topic: Interacting with lisp from a lispbuilder-sdl application
Replies: 9
Views: 14906

Re: Interacting with lisp from a lispbuilder-sdl application

Swank+slime is foreign to me - can't get myself to use emacs, though everybody says it's 'the-right-way-TM', so I wouldn't know how to use swank from my app. For now, a simple repl will do :) Ouch. I wince every time I hear someone say this. Not that I don't think there couldn't be something better...
by Paul Donnelly
Mon Jun 29, 2009 5:32 pm
Forum: Common Lisp
Topic: Interacting with lisp from a lispbuilder-sdl application
Replies: 9
Views: 14906

Re: Interacting with lisp from a lispbuilder-sdl application

The first problem I bumped into is interacting with lisp - I would like the user to be able to talk directly to the lisp from the GUI window - in the same way that one can talk to lisp in the terminal. Right now, the best solution I achieved is that I have an input 'field' in my application where I...
by Paul Donnelly
Wed Jun 24, 2009 2:34 pm
Forum: Common Lisp
Topic: incorrect simple floating point math
Replies: 28
Views: 33149

Re: incorrect simple floating point math

If you're actually doing this stuff "for real", you probably want a BCD representation. I can't think of a reason why you would prefer BCD over pure binary integers. To my understanding, some accounting methods involve very specific rounding techniques based on base-10 encoding probably a...
by Paul Donnelly
Wed Jun 10, 2009 1:17 pm
Forum: Common Lisp
Topic: Replacing elements in a list
Replies: 22
Views: 24426

Re: Replacing elements in a list

Nope I say it again... It isnt homework Then why in the world are you so obsessed with this? LAMBDA isn't something you just “modify a function with” — what you say you want to do makes absolutely no sense that I can see. :| Could you describe the intended effect of this modification in more ...
by Paul Donnelly
Tue Jun 09, 2009 7:57 pm
Forum: Common Lisp
Topic: Replacing elements in a list
Replies: 22
Views: 24426

Re: Replacing elements in a list

Thanks but I've already combined two functions in a single one (defun myfunc (x) (cond ((null x) nil) ((< (car x) 0) (cons (intern (format nil "*~a" (car x))) (myfunc (cdr x)))) (T (cons (car x) (myfunc (cdr x)))))) And now I need to modify this function with lambda. Why? Is this homework...