On Fri, 18 Jan 2019 at 14:22 -0800, jackhfi...@gmail.com wrote: > When it comes to collections and data structures, what would you all like > to see in Racket2? New APIs? Changes to existing APIs? Whole new paradigms? > Something else?
Maybe you'll need to clarify what Racket2 is? I am not familiar. > - Distinct data types for pairs and lists, and more intuitive names for the > pair APIs (so `pair?` and `list?` would be mutually exclusive predicates > and you'd make and access pairs with `(pair 1 2)`, `(pair-first p)`, and > `(pair-second p)`. > > - 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. While these changes may make the language easier to read (slightly, easier to discern programmer intent in some cases), as well as slightly more reliable (harder to write incorrect programs), you'll have to consider the negative impacts as well. Programmers would often want a way to accept what was previously considered just a list, so we might see collection/c (or a similar name) come to be defined to (or/c list/c tuple/c ...). And, to work with these collections comes generic operations (collection-first ...). This may be the paradigm in other languages like Python, but Racket is not Python. My hunch is that this would make the language harder to write in, and create potential constraints when it comes to optimization. Jack -- Jack M. Rosenthal http://jack.rosenth.al No, sir... clicking on 'Remember Password' will NOT help you remember your password. -- 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: PGP signature