Search found 613 matches

by ramarren
Tue Jan 28, 2014 2:21 pm
Forum: Common Lisp
Topic: Question on 'let example - Successful Lisp
Replies: 5
Views: 11307

Re: Question on 'let example - Successful Lisp

There are multiple ways to implement DOTIMES complying with specification , but the most common would essentially execute something like this: (let ((fns ())) (let ((i 0)) (push #'(lambda () i) fns) (setf i (1+ i)) (push #'(lambda () i) fns) (setf i (1+ i)) (push #'(lambda () i) fns) (setf i (1+ i))...
by ramarren
Tue Jan 28, 2014 10:32 am
Forum: Common Lisp
Topic: Question on 'let example - Successful Lisp
Replies: 5
Views: 11307

Re: Question on 'let example - Successful Lisp

4. the list (3 3 3) is undesired and is the effect of the closure created by the 'let over the iteration variable 'i. WHY?! The closures here are created by LAMBDA, which creates an anonymous function closing over its environment. LET is incidental and just holds the anonymous functions so that the...
by ramarren
Sat Nov 10, 2012 10:53 am
Forum: Common Lisp
Topic: on function...
Replies: 2
Views: 5943

Re: on function...

LAMBDA is a macro that expands into (FUNCTION (LAMBDA ...)), so in CL they are equivalent. In some other contexts, like with many standard higher order functions, you can use both (FUNCTION function-name) (or #'function-name syntax) and (QUOTE function-name) (or 'function-name syntax), but they beh...
by ramarren
Thu Nov 08, 2012 12:34 pm
Forum: Homework
Topic: Help understanding my error
Replies: 1
Views: 7279

Re: Help understanding my error

First problem is that your recursion doesn't have a proper base case. Your IF doesn't have an else branch, so the result variable is returned as is, which is affected only by the first PUSH. This can actually be seen by indentation. Second problem is that you are trying to use PUSH in the first plac...
by ramarren
Tue Oct 30, 2012 7:33 am
Forum: Emacs Lisp
Topic: Watch elisp functions as they are executed in emacs
Replies: 3
Views: 20924

Re: Watch elisp functions as they are executed in emacs

I have moved the topic to Emacs Lisp section.
by ramarren
Fri Aug 24, 2012 2:16 am
Forum: Common Lisp
Topic: New to lisp and file IO
Replies: 2
Views: 5724

Re: New to lisp and file IO

First, LISP is not a language, it is a family of languages. Common Lisp is one of the languages of this family, and I assume you are asking about that since this is a CL subforum, but you should be clear about the difference when writing. The file chapter in Practical Common Lisp explains this. You ...
by ramarren
Sun Aug 19, 2012 11:30 am
Forum: Common Lisp
Topic: The elusive DEFTYPE
Replies: 1
Views: 5083

Re: The elusive DEFTYPE

I'm curious why this is - is it considered an advanced topic? Technically deficient? Not useful in practice? In my experience at least, DEFTYPE is not really that useful in practice, other than defining short names for complex array types and the like. The standard does not specify any type inferen...
by ramarren
Fri Aug 10, 2012 8:18 am
Forum: Common Lisp
Topic: The position in a stream
Replies: 4
Views: 8619

Re: The position in a stream

I have a strong feeling that this is not an use case anyone writing the standard thought of. I would say strictly speaking no, since the only requirement is "as if read had been called on an input stream containing those same characters. ", without requiring that the stream is fresh, altho...
by ramarren
Fri Aug 10, 2012 8:00 am
Forum: Common Lisp
Topic: psetf
Replies: 5
Views: 9795

Re: psetf

I can't believe you can't predict the order of such a computer language function output!! In this context "unpredictable" means that it depends on the implementation and the state of the system as whole, which means that even if you can predict the order in some circumstances, programs de...
by ramarren
Tue Jul 03, 2012 1:40 pm
Forum: Common Lisp
Topic: Writing a macro to define methods
Replies: 3
Views: 7963

Re: Writing a macro to define methods

Using macros seems to me like a premature optimization for this case. Although I know very little about specifics of elliptical curve algorithms, I doubt the cost of algorithm dispatch is that significant. You should probably write a version just using functions first.