Search found 35 matches

by imba
Thu Nov 25, 2010 3:25 pm
Forum: Other Tools
Topic: error compiling thinlisp-1.0.1
Replies: 0
Views: 5117

error compiling thinlisp-1.0.1

When compiling thinlisp-1.0.1 by (compile-tlt), I get the error "- PROCLAIM: ARRAY defines a type, cannot be declared a DECLARATION" (Compiling tlt/lisp/decls.lisp 8/38).

How can I fix this?
by imba
Thu Nov 25, 2010 11:33 am
Forum: Other Tools
Topic: ECL: Compile Lisp to C
Replies: 8
Views: 19142

Re: ECL: Compile Lisp to C

Thank you!
by imba
Thu Nov 25, 2010 11:10 am
Forum: Common Lisp
Topic: collecting *unique* in loop
Replies: 8
Views: 3346

Re: collecting *unique* in loop

That isn't what I want. I want not to collect then in the first place.
by imba
Thu Nov 25, 2010 9:26 am
Forum: Common Lisp
Topic: collecting *unique* in loop
Replies: 8
Views: 3346

collecting *unique* in loop

Hi.

In the following situation

Code: Select all

  (loop for a in l
        when cond
        collecting a)
How do I insure that every a is collected only *once*. Note: I don't want to apply something as "unique" to the result, but not to collect doublettes in the first time.
by imba
Thu Nov 25, 2010 7:40 am
Forum: Other Tools
Topic: ECL: Compile Lisp to C
Replies: 8
Views: 19142

ECL: Compile Lisp to C

Hi,

i followed the instructions in http://ecls.sourceforge.net/new-manual/ch24s06.html and compiled a .lisp file into .fas and .o files, and finally into an executable (Ubuntu 10.10). But how can I produce a .c file?
by imba
Wed Nov 24, 2010 2:03 pm
Forum: Common Lisp
Topic: loop and let
Replies: 6
Views: 2096

Re: loop and let

Warren Wilkinson wrote:A couple of ways

Code: Select all

(loop for f in g
          as fc = (and (>= f tr) (foo f))
          when (consp fc)
          collect fc)
Thanks, but with this I get "Error: The variable WHEN is unbound."

EDIT: I finally got it working! Thanks!
by imba
Wed Nov 24, 2010 1:25 pm
Forum: Common Lisp
Topic: loop and let
Replies: 6
Views: 2096

Re: loop and let

Stop, wait. I want the following:

Code: Select all

    (loop for f in g
          when (>= f  tr)
          for fc = (foo f)
          when (consp fc)
          collecting fc))
How do I correct this code? It is importent that fc is only evaluated when ">= f tr" is true.
by imba
Wed Nov 24, 2010 1:00 pm
Forum: Common Lisp
Topic: Returning from a function
Replies: 1
Views: 872

Returning from a function

I want the following:

Code: Select all

(defun foo
  (if (bar)
      (if (foobar)
          (print result)
        nil)
    (barfoo)
This should work as follows: If bar, then: return result if foobar, and nil if not foobar. If not bar, then return barfoo.

How do I have to modify my code for this?
by imba
Wed Nov 24, 2010 12:50 pm
Forum: Common Lisp
Topic: loop and let
Replies: 6
Views: 2096

Re: loop and let

Yes, but I didn't know how to introduce them syntactically here.
by imba
Wed Nov 24, 2010 12:21 pm
Forum: Common Lisp
Topic: loop and let
Replies: 6
Views: 2096

loop and let

Hi,

I want to eliminate the double-execution of (condition-on a) in the following source code:

Code: Select all

(loop for a in L
          when (consp (condition-on a))
          do (return (condition-on a)))
How do I do this?