Search found 613 matches
- Sat Mar 17, 2012 6:28 am
- Forum: Common Lisp
- Topic: load problem
- Replies: 1
- Views: 3281
Re: load problem
The proper way is to use a system definition facility like ASDF. Otherwise you have to use MERGE-PATHNAMES to create a full pathname to the file you want to load, either by using saved absolute path or *LOAD-PATHNAME* variable. But that might break if anything is file-compiled.
- Fri Mar 16, 2012 2:53 am
- Forum: Common Lisp
- Topic: Need a *general purpose* way to APPLY macros and special ops
- Replies: 9
- Views: 13066
Re: Need a *general purpose* way to APPLY macros and special
special operators can be called at runtime Special operators are not really "called" in the same sense that functions are. Special operators define a syntax for a certain operation. To construct the operation at runtime you have to build a code tree and then compile or interpret it. Hones...
- Fri Mar 16, 2012 1:58 am
- Forum: Common Lisp
- Topic: Need a *general purpose* way to APPLY macros and special ops
- Replies: 9
- Views: 13066
Re: Need a *general purpose* way to APPLY macros and special
regardless, so what about special operators then? They don't have any runtime issues... They do, what makes special operators special is that they are treated specially by the compiler/interpreter. You would have to construct the expression tree and then EVAL it for that to work, except that EVAL e...
- Fri Mar 16, 2012 12:44 am
- Forum: Common Lisp
- Topic: Need a *general purpose* way to APPLY macros and special ops
- Replies: 9
- Views: 13066
Re: Need a *general purpose* way to APPLY macros and special
Macros are expanded at macro expansion time and special operators have a special meaning to the compiler, so you cannot use them at runtime without invoking the compiler or at least the interpreter. While sort of possible the performance and complexity penalty would most likely make that useless.
- Tue Mar 13, 2012 3:32 am
- Forum: Common Lisp
- Topic: Strange Behavior: functions not work for a list/cons
- Replies: 4
- Views: 6288
Re: Strange Behavior: functions not work for a list/cons
Preface: Here is what happens with LIST-LENGTH in Common Lisp: LIST-LENGTH is in fact a standard Common Lisp function and works on my SBCL. It is specified to signal an error if the list is not a proper list or circular list, which are both subsets of lists. The specification for LISTP specifically...
- Sun Mar 04, 2012 2:08 pm
- Forum: Common Lisp
- Topic: Hi!two very quick noobish questions
- Replies: 3
- Views: 5507
Re: Hi!two very quick noobish questions
You might want to read a book like Gentle Introduction to Symbolic Computation for a more detailed explanation. what is the real difference beetween '(1 2) and '(1 . 2),and if my conclusion is correct,why would anyone want to use something like '(1 . 2)...is it something like a tuple? The difference...
- Thu Mar 01, 2012 11:08 pm
- Forum: Common Lisp
- Topic: Create a method dynamically for an instance of a class
- Replies: 4
- Views: 6570
Re: Create a method dynamically for an instance of a class
You might be interested in a prototype based object language extension such as Sheeple . Generally, adding function/methods at runtime is not the right thing, since if you are writing code calling them then you can just define them in the source and make them available at compile time, and if you ar...
- Fri Feb 24, 2012 12:20 am
- Forum: Common Lisp
- Topic: Optimizing speed and fixnum literal
- Replies: 7
- Views: 11897
Re: Optimizing speed and fixnum literal
Also see SBCLs modular arithmetic . The entry in the manual is I believe out of date, and the capabilities of the compiler in this case are actually greater than described. If you know that the result is going to be a positive fixnum then wrapping the whole computation with (logand most-positive-fix...
- Tue Feb 21, 2012 10:03 am
- Forum: Common Lisp
- Topic: LIST vs TICK in a LET causing a global side-effect?!?
- Replies: 6
- Views: 7735
Re: LIST vs TICK in a LET causing a global side-effect?!?
That was the key. Thank you. I can't decide if this is to be avoided or exploited...(feature or bug). Certainly for what I was doing it was bad. The "in undefined way" is important. Since the standard specifies the undefinedness explicitly , the implementation is allowed, but not required...
- Tue Feb 21, 2012 6:10 am
- Forum: Common Lisp
- Topic: Finding number of saddle points of a matrix
- Replies: 6
- Views: 8649
Re: Finding number of saddle points of a matrix
See this Stack Overflow question. The complexity cannot be lower than O(xy) because you have to touch every point of the matrix.