Search found 117 matches

by Warren Wilkinson
Mon Jan 17, 2011 10:52 am
Forum: Common Lisp
Topic: make source executable
Replies: 12
Views: 17240

Re: make source executable

If you need binary portability, you might have to use a specific lisp. There are a few ways to do it: Lisp produces an executable (or a DLL). Some Commerial lisps do this. The resulting binary/dll will probably be in the 50 meg range. Compile to C, use that to build distributable executables. Compil...
by Warren Wilkinson
Wed Jan 12, 2011 4:55 pm
Forum: Common Lisp
Topic: Binary Stream and Binary Types
Replies: 11
Views: 6632

Re: Binary Stream and Binary Types

Yes its not binary. The link you gave says pack should return a string, and unpack take a string. I'm guessing you want serialization of objects? Yes this is tricky, and C does it pretty well, since in C you can access the raw bytes. You have a few options, pick your poison. Use C data structures an...
by Warren Wilkinson
Wed Jan 12, 2011 2:07 pm
Forum: Common Lisp
Topic: Binary Stream and Binary Types
Replies: 11
Views: 6632

Re: Binary Stream and Binary Types

Yes, there is a pack.

Code: Select all

(defun pack (obj) (princ-to-string obj))

(defun unpack (str) (read-from-string str))
SBCL-only matters when you plan to run your code on other lisps. If you're only working with one, use the time saving devices it gives you.
by Warren Wilkinson
Tue Jan 11, 2011 9:50 pm
Forum: Common Lisp
Topic: Binary Stream and Binary Types
Replies: 11
Views: 6632

Re: Binary Stream and Binary Types

I just slurp the file into memory and access it with pointers. Something like this (in SBCL): (let ((data (read-sequence ...))) (sb-ext:with-pinned-objects (data) (let ((sap (sb-sys:vector-sap data))) (sb-sys:sap-ref-32 sap 0)))) ;; First word. Files suck in every language, I've always found it easi...
by Warren Wilkinson
Mon Jan 10, 2011 6:59 pm
Forum: The Lounge
Topic: LispForum stats
Replies: 5
Views: 7646

Re: LispForum stats

If we have that many registered lurkers, imagine how many unregistered ones we have.
by Warren Wilkinson
Mon Jan 10, 2011 12:13 pm
Forum: Common Lisp
Topic: Alternative to do*?
Replies: 2
Views: 2152

Re: Alternative to do*?

loop is a mini language within lisp , like format. (loop for a in '(1 3 5) do (format t "~%Value: ~a" a) do (format t "~%Value (again): ~a" a) do (format t "~%One last time: ~a" a)) Will show that those do's run sequentially. The confusion probably stems because Lisp (not the loop language) also ha...
by Warren Wilkinson
Sun Jan 09, 2011 11:56 pm
Forum: Common Lisp
Topic: 2D graphics/turtle lib suitable for kids?
Replies: 17
Views: 19455

Re: 2D graphics/turtle lib suitable for kids?

I'm all for simplicity, and I'll take it in whatever form it comes in, low level or high. Resolution independence shouldn't be that hard: turn +width+ and +height+ to *width* and *height*, set them to your resolution and rerun the program. That is how postscript does it, it's just a variant of Forth...
by Warren Wilkinson
Sun Jan 09, 2011 7:56 pm
Forum: Common Lisp
Topic: 2D graphics/turtle lib suitable for kids?
Replies: 17
Views: 19455

Re: 2D graphics/turtle lib suitable for kids?

I wanted to demonstrate the simplicity of raw pixel pushing. I wrote the library I was talking about, it took under an hour. It requires SDL, SBCL, and no other libraries. Makefile gfx.so : gfx.c gcc -c -fPIC `sdl-config --cflags` `sdl-config --libs` gfx.c && ld -shared -o gfx.so gfx.o gfx.c #includ...
by Warren Wilkinson
Sun Jan 09, 2011 2:24 pm
Forum: The Lounge
Topic: Totally Newfang!
Replies: 8
Views: 11375

Re: Totally Newfag!

Add an 'n' and become 'newfang' short for newfangled. There are three main hurdles before you: The first hurdle is to get lisp (any lisp) running. The second is to get an IDE you can live with The third is to familiarize yourself with the basics. Get a good starter book and retype and run the exampl...
by Warren Wilkinson
Sun Jan 09, 2011 2:17 pm
Forum: Common Lisp
Topic: 2D graphics/turtle lib suitable for kids?
Replies: 17
Views: 19455

Re: 2D graphics/turtle lib suitable for kids?

You're not teaching trigonometry, but basic geometry. You're still working from coordinates, just abstract ones. fd 1 (forward one, in a hypothetical dialect) could be one pixel (it was in Apple Logo) but it could also be an arbitrary distance, with 1.235 as a possibility, as well. Advocating direc...