Square in R7RS

It's one of the most trivial library functions ever:

(define (square x) (* x x))

But I've written it many times, and I'm not alone. So it was a pleasant surprise to see that WG1 recently voted to add it to R7RS.

The request gave the (weak) reason that it could have an optimized method for bignums, but voter comments suggest they were more interested in symmetry with sqrt. They also added make-list for symmetry with make-vector. I don't think symmetry is a good reason in either case, let alone sufficient reason to add features to Small Scheme, but square is attractive as a convenience.

It's not the most important feature (and it probably belongs in Big Scheme, not Small Scheme), but it's a small step forward. Every language that aims to be convenient should have square in its standard library.

4 comments:

  1. I actually find myself writing make-list occasionally when writing tests. CompleteSequenceCowan shows the procedures WG1 added for symmetry between lists, strings, and vectors. Bytevectors, however, only have a subset of these.

    ReplyDelete
  2. I have always had a good impression of Ray-Ban.uk replica ray bans I just happened to buy it at this store. I chose this classic, I am very beautiful. discounted ray bans clubmaster After that, I found that the activity price was 50% cheaper than usual or other e-commerce. Very valuable

    ReplyDelete
  3. Mon copain aime copier des montres. pas cher montre Lorsque vous la rachetez, cette magnifique montre réplique est magnifique. Le design et la fonction de la montre sont très frais et élégants. La qualité est relativement parfaite.replique montblanc star automatic montre Cette réplique de montre est très spéciale, de bonne qualité et bon marché

    ReplyDelete
  4. I bought this copy of jimmy choo shoes and clothes from this store.Fake Jimmy Choo shoes The quality is very good. It has been repurchased many times.replica women Jimmy Choo sandals I recommend it to friends around me. They all praise the quality of the shoes and the service attitude of the store.

    ReplyDelete

It's OK to comment on old posts.