Search found 8 matches
- Thu Jul 14, 2011 3:56 am
- Forum: newLISP Graphics & Sound
- Topic: graphic file
- Replies: 1
- Views: 6940
graphic file
Is there a way to open graphic file in newLisp? For example jpeg or gif file? I understand that there is a way to import C libs, but libjpeg, for example, includes work with pointers and I don't know how to make it possible in newLisp.
- Sun May 01, 2011 12:25 pm
- Forum: newLISP in the real world
- Topic: destructive functions & trees
- Replies: 5
- Views: 2554
Re: destructive functions & trees
Thank you fro the answers, that solved the problem.
- Sun May 01, 2011 3:58 am
- Forum: newLISP in the real world
- Topic: destructive functions & trees
- Replies: 5
- Views: 2554
Re: destructive functions
It doesn't work with passed values.
This won't change the variable.
Code: Select all
(set 'x '(0 1 2 '(3 4)))
(define (destruct lst) (setf (lst 3 0) 1))
(destruct x)
-> 1
This won't change the variable.
- Sun May 01, 2011 12:40 am
- Forum: newLISP in the real world
- Topic: destructive functions & trees
- Replies: 5
- Views: 2554
destructive functions & trees
I have a few questions about destructive functions. Can anybody explain why setf doesn't work with passed values ? It may return correct value, but it doesn't change the variable itself. PS maybe it would be better if I describe full problem: I need to edit branches or / and leafs inside a tree. I w...
- Sun Mar 06, 2011 7:16 pm
- Forum: newLISP in the real world
- Topic: [solved] OOP
- Replies: 8
- Views: 3784
Re: Objects
Thanks for good answers.
- Sun Mar 06, 2011 8:53 am
- Forum: newLISP in the real world
- Topic: [solved] OOP
- Replies: 8
- Views: 3784
Re: Objects
A direct translation of the Scheme code to newLisp might be: ; make-square ; 2011-03-05 ; example ; (set 's1 (make-square 2)) ; (s1 'area) ;result = 4 ; (s1 'perimeter) ;result = 8 ; (s1 'xxx) ;result = "unknown message" error (define (make-square side) (letex (s side) (lambda (msg) (cond ((= msg '...
- Sun Mar 06, 2011 8:45 am
- Forum: newLISP in the real world
- Topic: [solved] OOP
- Replies: 8
- Views: 3784
Re: Objects
Thanks for the answers. I read about FOOP. Simply this lambda conception looked interesting for me.
- Sat Mar 05, 2011 9:55 pm
- Forum: newLISP in the real world
- Topic: [solved] OOP
- Replies: 8
- Views: 3784
[solved] OOP
I found an interesting piece of code in scheme, but I failed to make it work in newLisp. Can anybody explain why? (define (make-square side) (lambda (msg) (cond ((eq? msg 'area) (* side side)) ((eq? msg 'perimeter) (* 4 side)) (else (error "unknown message"))))) > (define s1 (make-square 4)) > (s1 '...