Search found 538 matches

by nuntius
Wed Sep 02, 2015 2:57 pm
Forum: Common Lisp
Topic: Is that an NREVERSE bug? (SBCL)
Replies: 7
Views: 17379

Re: Is that an NREVERSE bug? (SBCL)

Not an SBCL bug, just a common pitfall for users. "nreverse might either create a new sequence, modify the argument sequence, or both." http://www.lispworks.com/documentation/HyperSpec/Body/f_revers.htm Note the *might*. SBCL's warning is correct style. SBCL's behavior is conforming to the...
by nuntius
Sun Mar 29, 2015 8:16 am
Forum: Common Lisp
Topic: (SB)CL: code creates endless loop while it is loaded...
Replies: 5
Views: 13105

Re: (SB)CL: code creates endless loop while it is loaded...

Here's a "fixed" version of your function. (let ((stream) (initialized 0)) (defun readsched (schedname) ;; if called the first time, open stream (if (eql initialized 0 ) (setf stream (open schedname))) ;; set the variable to 1, so stream will not be opened twice (setq initialized 1) ;; rea...
by nuntius
Mon Feb 09, 2015 11:04 pm
Forum: Common Lisp
Topic: Save data structures directly (not as pointer)
Replies: 2
Views: 9041

Re: Save data structures directly (not as pointer)

Lisp macros provide features equivalent to C++ templates and preprocessor macros.
You probably need to define a custom macro for what you want.
by nuntius
Mon Feb 02, 2015 3:11 pm
Forum: Scheme
Topic: Is there an easy-to-use compiler for Scheme?
Replies: 2
Views: 21011

Re: Is there an easy-to-use compiler for Scheme?

Yes, Racket has everything you are looking for, including support for SICP. http://racket-lang.org/ Many other good Scheme implementations are able to run SICP code, but I think they require a bit more work to get started. Here's a guide that uses MIT Scheme. http://hackerretreat.com/why-how-start-s...
by nuntius
Wed Jan 21, 2015 11:26 pm
Forum: Common Lisp
Topic: Beginner trying to understand "DO" loops
Replies: 4
Views: 9484

Re: Beginner trying to understand "DO" loops

I haven't read the code carefully, but this problem sounds familiar. You're probably thinking that DO has the binding semantics of DO*. In other words, all the variables created ("bound") by DO are evaluated in parallel. A change in the first variable is not visible to the others until the...
by nuntius
Thu Dec 25, 2014 9:22 pm
Forum: Common Lisp
Topic: Text and graphics
Replies: 1
Views: 5678

Re: Text and graphics

by nuntius
Mon Dec 22, 2014 8:36 pm
Forum: The Lounge
Topic: mercurial window
Replies: 1
Views: 7028

Re: mercurial window

Building a project is part luck, with healthy doses of skill and effort. Every once in a while an odd project becomes inexplicably famous or a good project is passed by. Usually, fundamental reasons can be found. Solid design, solving a common problem, providing a novel capability, engagement with a...
by nuntius
Mon Dec 22, 2014 8:19 pm
Forum: Common Lisp
Topic: Local functions in common Lisp?
Replies: 2
Views: 6849

Re: Local functions in common Lisp?

So DEFUN defines a global function, even when nested in another function. So its actually easy (and sometimes encouraged) to write functions that create other functions... I'm not sure why FOO is working, but there's a good chance some DEFUN in the past brought it into existence. Use FLET or LABELS ...
by nuntius
Tue Nov 11, 2014 7:53 pm
Forum: Common Lisp
Topic: reinitialize a ccl repl session
Replies: 1
Views: 5831

Re: reinitialize a ccl repl session

See the notes in this page.

http://www.lispworks.com/documentation/ ... cp_rdt.htm

If that isn't what you want, then please describe what should happen when you reinitialize the session.
by nuntius
Mon Nov 10, 2014 8:11 pm
Forum: Common Lisp
Topic: Newbie problem - defun
Replies: 2
Views: 6772

Re: Newbie problem - defun

In Lisp, the first token after an opening parenthesis, '(', is generally a function or macro. In your example, you wrote "(* (x 0.5))". By default, there is no function named "x". You meant to write "(* x 0.5)". Common issue when you're starting. In Common Lisp, the var...