development release version 9.0 2

Notices and updates
Locked
Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

development release version 9.0 2

Post by Lutz »

• HTTP mode now working on Win32
• other bugfixes and additions

For files and changes notes see

http://newlisp.org/downloads/development/

Lutz

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

Thanks Lutz,

I actualy dont know any other programming language
that has this much "useful!" variation on functions ..

..great enhancements again on lists ....;-)


Norman.
-- (define? (Cornflakes))

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

(explode lst 2) gives us the 'pair' function, I presume? Clever to place it there - sort of like a cluster bomb... :-)

rickyboy
Posts: 607
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Post by rickyboy »

Lutz,

I just built 9.0.2 on Linux and the end of 'qa-dot' says:

Code: Select all

TESTING FINISHED WITH ERRORS:

>>>> pipe failed nil
Should I worry? --Ricky
(λx. x x) (λx. x x)

Fanda
Posts: 253
Joined: Tue Aug 02, 2005 6:40 am
Contact:

Post by Fanda »

I also have a question:

When using 'mat':
> (mat * '((1 2) (3 4)) 2)
((2 4) (6 8))

I would like to exchange operators to something else using 'op':

'op' is a function:
> (set 'op +)
+ <40B246>
> (mat op '((1 2) (3 4)) 2)
illegal parameter type in function mat : '((1 2) (3 4))

'op' is a symbol:
> (set 'op '+)
+
> (mat op '((1 2) (3 4)) 2)
illegal parameter type in function mat : '((1 2) (3 4))

How does 'mat' work with + - * and / ???

Thanks, Fanda

PS: New 'explode' on lists is great!

Fanda
Posts: 253
Joined: Tue Aug 02, 2005 6:40 am
Contact:

Post by Fanda »

... I found the way, but I wish it was easier:

Code: Select all

(set 'op '+) => +
(eval (list 'mat op ''((1 2) (3 4)) 2)) => ((3 4) (5 6))
(eval (list mat op ''((1 2) (3 4)) 2)) => ((3 4) (5 6))

(set 'op '*) => *
(eval (list mat op ''((1 2) (3 4)) 2)) => ((2 4) (6 8))

(set 'op '/) => /
(eval (list mat op ''((1 2) (3 4)) 2)) => ((0.5 1) (1.5 2))
And here is the reason, why I needed it :-)

Code: Select all

(define-macro (vec op u v)
  (setq u (list (eval u)))

  (setq v (eval v))
  (unless (number? v)
    (setq v (list v)))

  (first (eval (list mat op 'u 'v))))

Code: Select all

(vec + '(1 2) '(3 4)) => (4 6)
(vec * '(1 2) '(3 4)) => (3 8)
(vec - '(1 2) '(3 4)) => (-2 -2)
(vec / '(1 2) '(3 4)) => (0.3333333333 0.5)

(vec + '(1 2) 5) => (6 7)
Fanda

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

There is an easier way:

Code: Select all

(define (vec op u v) (map op u v))

(vec + '(1 2) '(3 4)) => (4 6)
Lutz

rickyboy
Posts: 607
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Post by rickyboy »

Lutz wrote:There is an easier way:

Code: Select all

(define (vec op u v) (map op u v))

(vec + '(1 2) '(3 4)) => (4 6)
This might be even better:

Code: Select all

(define vec map)
Then there would be no intervening 'lambda' in calls to 'vec'. --Rick
(λx. x x) (λx. x x)

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

I just built 9.0.2 on Linux and the end of 'qa-dot' says:
Code:
TESTING FINISHED WITH ERRORS:

>>>> pipe failed nil

Should I worry? --Rick
Don't worry. I just rechecked Debian 3.1 and Fedora FC2 and they are both fine. Probably the timing was too short. Try again or change (sleep 1000) to (sleep 2000) in function 'test-pipe'.
(define vec map)
Yes this is the best, they really do both the same thing.

Lutz

Locked