When using settable-fn.arc:
(def create-my-type () (add-attachments 'key (fn () (generate-keys)) ; note the order: value before key(s) '= (fn (v k) (assign-value-v-to-key-k v k)) (annotate 'my-type (fn (k) (lookup-in-k k)))))
(def create-my-type () (add-attachments 'key (fn () (generate-keys)) '= (fn (v k) (assign-value-v-to-key-k v k)) 'type 'my-type (fn (k) (lookup-in-k k))))
http://arclanguage.com/item?id=3595 Suggest PG: Settable function objects
http://arclanguage.com/item?id=3698 Create your own collection in Arc: settable functions now implemented on arc-wiki.git
http://arclanguage.com/item?id=3762 Create your own collection: use directories as if they were tables with file-table
http://arclanguage.com/item?id=3858 Create your own collection: bidirectional tables
http://arclanguage.com/item?id=5254 Create your own collection: cached-table
http://arclanguage.com/item?id=7365 Create your own collection: proto-table, when you want prototyping semantics in your object system
-----