Search found 613 matches

by ramarren
Wed Jul 23, 2008 10:15 am
Forum: Common Lisp
Topic: Programming Style & (eval ...)
Replies: 17
Views: 58487

Re: Programming Style & (eval ...)

Actually, I am not sure how this works really, but I think so. Macros are normal functions after all, they are just called by the compiler on the source tree... of course, in my SBCL: CALL-ARGUMENTS-LIMIT is an external symbol in #<PACKAGE "COMMON-LISP">. It is a constant; its value is 536...
by ramarren
Wed Jul 23, 2008 3:07 am
Forum: Common Lisp
Topic: Parsing large real numbers
Replies: 4
Views: 11673

Re: Parsing large real numbers

The numbers are actually a number of seconds from the Unix Epoch. CLISP also has arbitrary precision floats . Or course, those are slow. But in this particular case, if you may want to parse the seconds and second fraction as integers and either convert them to rational, or handle them separately. ...
by ramarren
Tue Jul 22, 2008 9:09 am
Forum: Common Lisp
Topic: Programming Style & (eval ...)
Replies: 17
Views: 58487

Re: Programming Style & (eval ...)

I ran into a problem right away though when trying to write all which takes a predicate and a list, returning true when all the elements in the list satisfy the predicate. First, note that such function already exists: every . My first thought was that this is just a fold of the and operation into ...
by ramarren
Tue Jul 22, 2008 5:22 am
Forum: Common Lisp
Topic: CLISP
Replies: 5
Views: 15761

Re: CLISP

Common Lisp doesn't have a concept of program as such. You just start an environment, load the code, and run a function you want. If you are on Linux and really want to launch "programs", you can investigate cl-launch . Or perhaps creating executables . But these are not the usual ways to ...
by ramarren
Tue Jul 22, 2008 4:54 am
Forum: Common Lisp
Topic: Confused ....
Replies: 6
Views: 18263

Re: Confused ....

ahh, i expiremented a little .... and got it ... defparameter establish dynamic variable so "a" in (defun test (a) ...) is dynamic not lexical (that's is what confused me, i thought "a" is lexical inside the function) As far as I know, there is no way to un-special (ie. turn dyn...
by ramarren
Tue Jul 22, 2008 3:15 am
Forum: Common Lisp
Topic: Confused ....
Replies: 6
Views: 18263

Re: Confused ....

I dont get second example, it should see dynamic binding ... afik :) But you do see dynamic binding, so what is confusing? In the second example a is bound to symbol b, and the symbol-value returns, which is a function, returns the dynamic binding of b. In the first example a is bound to a, and the...
by ramarren
Sat Jul 19, 2008 10:30 am
Forum: Common Lisp
Topic: Packages
Replies: 4
Views: 17853

Re: Packages

I still find myself having to load packages manually. Packages are not loaded (except in trivial sense, ie. in the same way all other Lisp code is). Packages are just namespaces, a way to associate strings with symbols. Most of the time you create a package, use other packages you want to be referr...
by ramarren
Wed Jul 16, 2008 11:23 am
Forum: Common Lisp
Topic: copy-list vs. copy-tree
Replies: 5
Views: 25192

Re: copy-list vs. copy-tree

What is the difference between our-copy-list and our-copy-tree? Remeber, Common Lisp doesn't have lists as such, only conses, which can be thought of as pairs of pointers, each of which can point to either an atom, or a list. List and trees can be easily built from those. So, our-copy-list copies l...
by ramarren
Wed Jul 16, 2008 9:29 am
Forum: Common Lisp
Topic: (eval) and (compile) considered lame?
Replies: 3
Views: 18849

Re: (eval) and (compile) considered lame?

that eval and compile would be perfect for building functions programmatically (although not closures if I understand correctly). What am I missing? Is there a better way? Building functions programmatically is usually achieved, as reuben.cornel shown, with macros. One reason use of eval and compil...
by ramarren
Mon Jul 14, 2008 7:01 am
Forum: Common Lisp
Topic: Passing values by reference
Replies: 12
Views: 42610

Re: Passing values by reference

I would like to reduce memory consumption as much as it is reasonable before processing this archive. Well, it is hard to say anything specific without looking at the code, but note that with generational garbage collection allocating and the throwing away object is pretty fast, so usually you only...