Search found 78 matches

by David Mullen
Thu Nov 10, 2016 6:46 pm
Forum: Common Lisp
Topic: Using a symbol at the same time its package is created
Replies: 3
Views: 10635

Re: Using a symbol at the same time its package is created

I appreciate the clarity, since my comment was intended to make the same point you're making about side effects. If you want something to "stick" in the FASL then you can't rely on side effects that don't stick across Lisp instances. Unlike you, I'm doing this on a laptop with Clozure CL, ...
by David Mullen
Tue Nov 08, 2016 8:31 pm
Forum: Common Lisp
Topic: Using a symbol at the same time its package is created
Replies: 3
Views: 10635

Re: Using a symbol at the same time its package is created

Well, if you're using intern in the macro, that's already a side effect. So make-package is just one more side effect. It's like you said—if you need to make a defconstant form, then you can't do that without having a symbol at macro-expansion time. I came up with this macro for illustrative purpo...
by David Mullen
Sun Nov 06, 2016 1:14 pm
Forum: Common Lisp
Topic: CLISP
Replies: 3
Views: 9981

Re: CLISP

(2 3 3) isn't a pair. You mean any list of numbers?
by David Mullen
Sat Oct 29, 2016 2:11 pm
Forum: Common Lisp
Topic: CommonQT nontrivial example?
Replies: 5
Views: 13535

Re: CommonQT nontrivial example?

I don't use Qt myself, but this guy has done a lot of work with it: http://shinmera.github.io/qtools/
by David Mullen
Thu Jun 16, 2016 1:48 pm
Forum: Homework
Topic: Horse Solitaire
Replies: 1
Views: 19219

Re: Horse Solitaire

In the definition and initial value form for *operadores*, it looks like it's wanting to call the LIST function, but the outer form is quoted, not evaluated.
by David Mullen
Tue May 24, 2016 12:48 pm
Forum: Scheme
Topic: problem with assoc
Replies: 7
Views: 33729

Re: problem with assoc

Each element of the association list is a list, so you want 'f' to be some element of that list—the second element, I guess? I mean, it's redundant to be mapping each symbol to itself.
by David Mullen
Sat May 14, 2016 2:13 pm
Forum: Homework
Topic: help understanding simple recursion
Replies: 2
Views: 8655

Re: help understanding simple recursion

Repeatedly printing X and Y doesn't reveal the whole process, whereas explicit nesting might make things clearer. The call (z 4 9) can be re-expressed, via the function definition, as: (inc (z (dec 4) 9)) Evaluating the innermost form, this becomes: (inc (z 3 9)) Rewriting the call to Z, like we did...
by David Mullen
Wed May 11, 2016 4:18 pm
Forum: The Lounge
Topic: Lisp to C converter.
Replies: 4
Views: 14730

Re: Lisp to C converter.

Wow, this is already looking fairly complete. It's easy to see this being an alternative to straight C/C++ for complicated simulation work. Embedded systems, too, since with modifications it could even compile to a specialized dialect like nesC , which I recall being kind of tedious to write, for so...
by David Mullen
Wed May 11, 2016 1:39 pm
Forum: Common Lisp
Topic: setq and assoc problem
Replies: 5
Views: 12904

Re: setq and assoc problem

The two lists are structurally different. The keys, in the latter example, are themselves lists. So you'd need to use a different test function in order to compare the keys effectively:

Code: Select all

(assoc '(chat) FrAng :test 'equal)