Re: Collections and data structures wishlist?

Matthias Felleisen <[email protected]>
Newsgroups gmane.comp.lang.racket.user,gmane.lisp.scheme.plt
Message-ID <[email protected]>
(define tuple/c list/c) 

The key to list/c and listof is that the code inside of 
functions contracted with either of them can use map 
and filter and everything else to process the arguments. 



> On Jan 24, 2019, at 8:33 AM, Gustavo Massaccesi <[email protected]> wrote:
> 
> I also like the idea of a contract like "tuple/c", perhaps with a more rackety name.
> 
> Gustavo
> 
> On Wed, Jan 23, 2019 at 12:02 PM Greg Hendershott <[email protected]> wrote:
> >> - A separation between using lists as homogeneous collections and using lists as fixed-size tuples. So there'd be a separate `tuple?` data type that's structurally equivalent to a list but meant to be used differently. For example, `(list/c number?)` would mean a list of many numbers, but `(tuple/c number?)` would mean a tuple of size 1 containing a number.
> >
> > "It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures.” http://www.cs.yale.edu/homes/perlis-alan/quotes.html
> > "It is better to have 100 transducers operate on one data structure interface than 10 functions on 10 data structures.” Rich Hickey, History of Clojure
> 
> Well also, I thought `list/c` already means "tuple"?
> 
> (listof number?) is a list of many numbers.
> (list/c number?) is a list of one number.
> 
> 
> I think it's within the Racket spirit to make a little #lang for
> certain audiences or projects. At some org, "tuple/c" might be a
> helpful alias. Or, for some other team, it's not, and in fact even
> "list/c" is redefined to raise an error, "Please use structs instead
> of ad hoc tuples."
> 
> -- 
> You received this message because you are subscribed to the Google Groups "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
For more options, visit https://groups.google.com/d/optout.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.