Neat!
Now when on the topic, some thoughts on what would be a next level in this, generally:
Clearly, there could be more features and it could be more efficient, but in terms of producing the simplest thing that works for me, I'm really happy with this:https://gist.github.com/eraserhd/5435505
Usage:(define-generic (length object))(add-method (length (vector? v))(vector-length s))(add-method (length (string? s))(string-length s))(add-method (length (list? l))(##length l))(length "hello") => 5(length '(1 2 3)) => 3(length '#(a b)) => 2
_______________________________________________
Gambit-list mailing list
Gambit-list@iro.umontreal.ca
https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list