Search found 11 matches

by TPJ
Fri Jan 16, 2009 4:32 am
Forum: Common Lisp
Topic: A "declare" form returned by macro
Replies: 19
Views: 13479

Re: A "declare" form returned by macro

Thank you all for your tips. In addition to all the other fine suggestions about how you can ease your pain in declaring types, might I suggest that you simply don't declare types at all. If you're really trying to write your first code in Common Lisp, the last thing you'll want to spend any time on...
by TPJ
Sun Jan 11, 2009 12:58 am
Forum: Common Lisp
Topic: Crosscompiling Linux->Windows
Replies: 7
Views: 9636

Re: Crosscompiling Linux->Windows

Thanks for your remarks! Since the time I wrote my post, I got a little more familiar with Lisp, because I got some practice. And I have to say it was a great experience! I decided to use two Lisp dialects: Common Lisp and Clojure. I find CL a slightly better than Clojure. Mainly because it doesn't ...
by TPJ
Tue Dec 30, 2008 6:36 am
Forum: Common Lisp
Topic: A "declare" form returned by macro
Replies: 19
Views: 13479

Re: A "declare" form returned by macro

Yeap. I'm studying the CLtL, but I obviously missed that information. Now I feel like a silly...

Thanks for your help.
by TPJ
Tue Dec 30, 2008 6:28 am
Forum: Common Lisp
Topic: Creating array with elements of a custom type
Replies: 2
Views: 2784

Creating array with elements of a custom type

Had a hard day coding in CL and looking for basic knowledge on this language. Let's assume I'll define a structure: (defstruct my-Str (slot-1 0 :type fixnum) (slot-2 0.0d0 :type double-float)) It's a new type. How can I make an array of elements of that type? I've tried (make-array (list 5) :element...
by TPJ
Tue Dec 30, 2008 5:23 am
Forum: Common Lisp
Topic: A "declare" form returned by macro
Replies: 19
Views: 13479

A "declare" form returned by macro

After xmas, I started to write my first code in Common Lisp. I started with the following function: (defun fixvect (f_len f_initEl) (declare (type fixnum f_len) (type fixnum f_initEl)) (make-array (list f_len) :element-type 'fixnum :initial-element f_initEl)) Of course, the function above is suppose...
by TPJ
Thu Dec 18, 2008 3:38 am
Forum: Common Lisp
Topic: Crosscompiling Linux->Windows
Replies: 7
Views: 9636

Re: Crosscompiling Linux->Windows

I'm a refugee from the Java world and I'm looking for some way of deploying Lisp apps. I'm not going to use CLisp, though, due to licensing issues (GPL is not an option for me). I have chosen SBCL. Let's assume that I'll develop my app on my Linux box. The app makes use of some libraries. Finally, I...
by TPJ
Thu Dec 18, 2008 3:28 am
Forum: Common Lisp
Topic: A newbie problem with generic function
Replies: 2
Views: 3197

Re: A newbie problem with generic function

Thanks for the answer. I felt it was something silly. :oops:
by TPJ
Tue Dec 16, 2008 1:11 pm
Forum: Common Lisp
Topic: A newbie problem with generic function
Replies: 2
Views: 3197

A newbie problem with generic function

I've got another Lisp-newbie question. I'm trying to define my own button class using the LTK package. In the ltk-mw package the following code can be found: (defgeneric redraw (widget)) (defclass redraw-on-resize () ()) (defmethod initialize-instance :after ((r redraw-on-resize) &key) (bind r "<Con...
by TPJ
Thu Nov 27, 2008 12:04 pm
Forum: Common Lisp
Topic: defvar, defparameter
Replies: 4
Views: 7104

Re: defvar, defparameter

Well, thank you all for your answers. I'm a Lisp newbie. I do realize I'm asking lame questions, but I haven't had any touch with Lisp before. Programming is my hobby, my passion, and now also my profession. I started to study Lisp, because I came to conclusion that I just can't afford not using thi...
by TPJ
Wed Nov 26, 2008 7:03 am
Forum: Common Lisp
Topic: defvar, defparameter
Replies: 4
Views: 7104

defvar, defparameter

From "Practical Common Lisp", chapter 6 "Variables": "Practically speaking, you should use DEFVAR to define variables that will contain data you'd want to keep even if you made a change to the source code that uses the variable. For instance, suppose the two variables defined previously are part of ...