Search found 17 matches

by virex
Tue Jul 31, 2012 5:19 am
Forum: Common Lisp
Topic: How to create package / system files?
Replies: 4
Views: 8186

Re: How to create package / system files?

IIRC, you can use the variable

Code: Select all

asdf::*default-source-registry*
to see in what directory ASDF starts looking. You can also specify this yourself, using the interface edgar-rft linked to, but that's quite a bit of a clusterfoo.
by virex
Tue Jul 31, 2012 5:15 am
Forum: Common Lisp
Topic: global variable
Replies: 3
Views: 7141

Re: global variable

Hi, Can we define global variable in lisp !? If we have it in lisp, how we can define it ? (defvar foo 3) Creates a global variable and assings it the value 3. (defvar foo 3 "This is foo, which should be 3") Does the same, but associates a docstring to it, which will be shown if you (insp...
by virex
Tue Jul 31, 2012 4:42 am
Forum: Common Lisp
Topic: Problem calling a macro
Replies: 3
Views: 7561

Re: Problem calling a macro

Macros run (are expanded) at compile-time. Functions run at run-time. Hence, functions cannot call macros. A macro form can appear in a function's body, of course. But the same principle applies: The macro is expanded during compilation, not when the function is called. Assuming you have the follow...
by virex
Tue Jul 31, 2012 4:38 am
Forum: Common Lisp
Topic: Lisp
Replies: 9
Views: 17077

Re: Lisp

SBCL or CCL are probably fast enough to handle the non time-critical parts of a game (or everything, if you're willing to settle for something that looks like it's from 2008). If I'd be doing an advanced game in Lisp, I'd probably write the critical parts as functions in C or ASM and call those from...
by virex
Tue Jul 31, 2012 4:33 am
Forum: Common Lisp
Topic: What it means ?
Replies: 3
Views: 5955

Re: What it means ?

I can not understand this line of code : (defun loop?_0 (x) (eql x 4)) "?" is a part of the function's name ? or something else !? Lisp allows you to use all ascii-characters (IIRC, could be printable ascii characters) or unicode characters, depending on the native character set of your i...
by virex
Tue Jan 10, 2012 3:00 pm
Forum: Common Lisp
Topic: avoiding eval in a macro
Replies: 3
Views: 5374

Re: avoiding eval in a macro

The problem isn't scoping, it's that your backquoting levels aren't in order. The inner defmacro is inside a single backquote, so the call to ,@body is going to look for body outside of that backquote level and it finds a symbol, not a list (because that's what you introduced with intern). But the c...
by virex
Thu Nov 24, 2011 11:12 am
Forum: Common Lisp
Topic: couple of lisp questions
Replies: 4
Views: 5609

Re: couple of lisp questions

Easiest way would be to let Lisp copy the list for you (say hi to copy-tree) and destructively alter the new list (technically a tree since it can contain sublists, hence the use of copy-tree as opposed to copy-list). |Then just check if the final argument is a cons or a number and handle each case ...
by virex
Thu Nov 24, 2011 8:04 am
Forum: Common Lisp
Topic: find list in a list function
Replies: 6
Views: 8107

Re: find list in a list function

Or if you prefer loops you could also use: (The proposed recursive version should be tail-recursive, but if you're unlucky with your compiler/interpreter it may blow the stack for very large lists) (defun sublist-p (list) (loop for el in list for sublist-p = (consp el) do (when sublist-p (return t))...
by virex
Tue Nov 01, 2011 11:56 am
Forum: Common Lisp
Topic: Trouble loading some libraries using CFFI
Replies: 4
Views: 6382

Re: Trouble loading some libraries using CFFI

The behavior is the same under CCL 1.6 (the version I posted) and the version of SBCL I have (0.9.8.1? Most recent stable windows build as of June, IIRC). However, Ramarren seems to have nailed it, I need to load libfreetype-6.dll before loading sdl-ttf.dll. Now I just need to figure out in what ord...
by virex
Sun Oct 30, 2011 1:18 pm
Forum: Common Lisp
Topic: Trouble loading some libraries using CFFI
Replies: 4
Views: 6382

Re: Trouble loading some libraries using CFFI

So I should load the Freetype library first?