Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - incogn1to

#1
newLISP Graphics & Sound / graphic file
July 13, 2011, 08:56:08 PM
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.
#2
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 wanted to pas the branch as a parameter to my changing function, and process it with destructive pop and push functions, but it doesn't work. Is there a right way to do this?
#3
newLISP in the real world / [solved] OOP
March 05, 2011, 01:55:14 PM
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 'area)
> 16