[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

changes



I intend to add all the hyperbolic trig functions to Scheme.  Also, the
gamma function, Bessel functions, and Legendre polynomials.  I use these
all the time and don't know how anyone gets by without them.

I think Scheme numbers are really ad hoc.  The ring should be a required
argument to +, *, etc. so that they know where the answer should come
from.  (E.g. (+ 4 7 (MOD Z 5)) ==> 1.)  Scheme should support arithmetic
mod N, polynomial arithmetic, and arithmetic in arbitrary algebraic
number fields.  Complex number fall out as a special case:

  (SQRT -1 (MOD (POLY R) (LAMBDA (X) (+ (* X X) 1 R))))  ==>  1i

This should be easy to implement.

I don't see why we need all these random special forms.  For example,
there's no need to have QUOTE or LAMBDA.  We can write

  (SET! (X Y Z) (+ X (* Y Z N) N))

instead of 

  (LAMBDA (X Y Z) (+ X (* Y Z N) N)).

No ambiguity will result because if the first thing is a list then
obviously the expression can't be an assignment.  Similarly, we should
be writing

  (SET! (D #(A (B C) 4)))

instead of

  (QUOTE (D #(A (B C) 4)))

because what would one-argument SET! mean?

I don't understand why there's no existential quantifer in Scheme.
For example, I often find myself wanting to write

  (EXISTS (X) (AND (MEMQ X L1) (MEMQ X L2)))

to find out whether the lists L1 and L2 intersect.

If we have first-class continuations I don't see any reason why we
shouldn't have first-class stores also.  E.g.

  (LET ((Z (CONS 1 2)))
    (CALL-WITH-CURRENT-STORE
       (LAMBDA (S)
	 (SET-CAR! Z 3)
	 (LIST (CAR Z) (S (LAMBDA () (CAR Z)))))))
   ==> (3 1)

And while we're on the subject of modules, why don't we just adopt
Common Lisp's package system wholesale?  It's really useful and elegant.
Also Zetalisp's LOOP construct is really good.

I'll put all these features in the report (Penguin Books has already
expressed interest, by the way) unless people send me enough money.

Modestly,
Jonathan Rees
Editor