Search found 11 matches

by ant
Thu Nov 17, 2011 4:03 pm
Forum: newLISP in the real world
Topic: variable capture?
Replies: 14
Views: 36360

Re: variable capture?

Thanks again for the suggestions. I have a lot to learn!
by ant
Tue Nov 15, 2011 8:27 pm
Forum: newLISP in the real world
Topic: variable capture?
Replies: 14
Views: 36360

Re: variable capture?

I think I'm starting to understand. Thank you every one who patiently explained and suggested alternatives. I'm using macros because I'm passing large-ish objects around (bitmaps) and for performance reasons I don't want newLISP to create a copy of these objects every time I call a function passing ...
by ant
Mon Nov 14, 2011 9:45 pm
Forum: newLISP in the real world
Topic: variable capture?
Replies: 14
Views: 36360

Re: variable capture?

I am a newLISP noob. There is almost nothing I understand of the culture. I thought I was using the style suggested in the article http://www.newlisp.org/downloads/newlisp_manual.html#define-macro . I thought it meant: use letex with args to avoid variable capture. I'm still confused. I don't unders...
by ant
Mon Nov 14, 2011 10:29 am
Forum: newLISP in the real world
Topic: variable capture?
Replies: 14
Views: 36360

Re: variable capture?

Hi and thanks both for replying. I'm still trying to puzzle it out.

I don't quite get why your fix, Lutz, affects just the lst variable. Why aren't the other variables susceptible to the same problem?
by ant
Sun Nov 13, 2011 8:55 pm
Forum: newLISP in the real world
Topic: variable capture?
Replies: 14
Views: 36360

variable capture?

I don't understand what I'm doing wrong here. Is it variable capture? Using the example from the define-macro description in the newLISP doc I wrote two identical test functions, apart from the name of the parameter: (define-macro (dolist-while) (letex (var (args 0 0) lst (args 0 1) cnd (args 0 2) b...
by ant
Mon Nov 07, 2011 11:27 pm
Forum: newLISP in the real world
Topic: why can't I setf a char in a string containing nulls?
Replies: 7
Views: 2440

Re: why can't I setf a char in a string containing nulls?

Yes, that demo is the point from which I started hacking. I'll pursue my bitmap effort a little further and see what FPS I get. I'll probably have further questions. If I think the end result is likely to be of any interest to anyone else I will make it freely available. Thank you again.
by ant
Mon Nov 07, 2011 5:24 pm
Forum: newLISP in the real world
Topic: why can't I setf a char in a string containing nulls?
Replies: 7
Views: 2440

Re: why can't I setf a char in a string containing nulls?

Lutz, I appreciate you taking the time to answer my newbie questions. I found this worked for me: (define (set-pixel x y r g b) (let (i (* (+ x (* y WIDTH)) 3)) (cpymem (pack "bbb" r g b) (+ (address rgb-buf) i) 3))) Your suggestion meant rewriting the entire bitmap to change one pixel, which seemed...
by ant
Sun Nov 06, 2011 10:04 pm
Forum: newLISP in the real world
Topic: why can't I setf a char in a string containing nulls?
Replies: 7
Views: 2440

Re: why can't I setf a char in a string containing nulls?

Hi Lutz, thank you for the suggestion. In view of what you say can you suggest the most appropriate data type to use to pass to glDrawPixels? I want to create a contiguous array of RGB binary byte values to pass to this function and I want to manipulate the contents of this buffer in LISP, to displa...
by ant
Sat Nov 05, 2011 11:27 pm
Forum: newLISP in the real world
Topic: why can't I setf a char in a string containing nulls?
Replies: 7
Views: 2440

why can't I setf a char in a string containing nulls?

I'm trying to set a character value in a string containing zeros. Is the following behaviour correct? newLISP v.10.3.3 on OSX IPv4/6 UTF-8, execute 'newlisp -h' for more info. > > (set 's "abc") "abc" > (setf (s 1) "X") "X" > s "aXc" > (set 's "\000\000\000") "\000\000\000" > s "\000\000\000" > (len...
by ant
Tue Oct 25, 2011 7:39 pm
Forum: newLISP Graphics & Sound
Topic: glDrawPixels possible?
Replies: 2
Views: 7610

Re: glDrawPixels possible?

Hi Lutz, Thanks for the info. I'm trying it now but I haven't succeeded in getting anything on the screen yet. I'll keep at it. Ant
by ant
Mon Oct 24, 2011 9:36 pm
Forum: newLISP Graphics & Sound
Topic: glDrawPixels possible?
Replies: 2
Views: 7610

glDrawPixels possible?

Is it possible to use glDrawPixels from a newLISP script? I want to display an image I've constructed in an array of RGB values.

If it is possible, could you point me to the documentation or an example?

If it isn't possible, am I trying to do something newLISP is not designed for?