[racket] Interesting article

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Wed Aug 11 18:09:20 EDT 2010

On Wed, Aug 11, 2010 at 4:01 PM, Martin DeMello <martindemello at gmail.com> wrote:
> What is the racket team's stance on core support for vectors and
> hashes, in terms of syntax for literals and making containers act as
> functions of their keys? The latter, in particular, would be a huge
> win, though it would also be a pretty large change to the language -
> I'm interested in what people feel the pros and cons of having it
> included would be, independent of the implementation difficulty.

There is literal syntax for vectors and hashes:

> (vector 1 2 3)
'#(1 2 3)
> > (hash 1 2)
'#hash((1 . 2))
> (hasheq 1 2)
'#hasheq((1 . 2))
> (hasheqv 1 2)
'#hasheqv((1 . 2))
> (vector-ref `#(1 ,(add1 2) 4) 1)

I'm theoretically in favor of containers as standard "ref" functions.
This would be pretty easy to implement [1] although it would slow
everything down.

Many of this person's complaints seem to indicate that they aren't
familiar with the dict or sequence APIs and that those APIs are not
complete enough.


1. The VM would provide vectors, etc, but they would be exposed to
#lang racket as structs with the prop:procedure property.

Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University

"The glory of God is Intelligence" - D&C 93

Posted on the users mailing list.