Re: [julia-users] Types and the Liskov Substitution Principle

2015-08-23 Thread Kevin Squire
If the type hierarchy is implemented well, functions for `Dict` would ideally be written to work with `super(Dict)` (i.e., `Associative`). And in fact, some are--e.g., `in`, `haskey`, `show`, `keys`, `values`, etc. See `base/dict.jl` for the implementation. Now, it could be argued that the type

[julia-users] Types and the Liskov Substitution Principle

2015-08-23 Thread Joshua Ballanco
Hello all, Apologies in advance if I’m missing something obvious. I’ve only just started experimenting with some of the more advanced features of Julia’s types, and I’ve hit a bit of a wall… Say I wanted to replicate something like Python’s `collections.defaultdict` or Ruby’s `Hash` class

Re: [julia-users] Types and the Liskov Substitution Principle

2015-08-23 Thread Joshua Ballanco
On August 23, 2015 at 21:08:16, Kevin Squire (kevin.squ...@gmail.com) wrote: If the type hierarchy is implemented well, functions for `Dict` would ideally be written to work with `super(Dict)` (i.e., `Associative`).  And in fact, some are--e.g., `in`, `haskey`, `show`, `keys`, `values`, etc.