Arc Forumnew | comments | leaders | submitlogin
2 points by shader 4847 days ago | link | parent

I did an experiment where annotate produced a list, of the form ('tagged x type1 type2 ...), making the tagged lists transparent objects to the arc system. In doing so, I extended the type system to include the original type of the object in the list and support more than one type, allowing a simple form of inheritance through coercion. I.e. if you annotated a list as type 'foo, until you defined an actual coercion method for converting 'foo to a cons it would be treated as a normal list, and you wouldn't lose any ability to work with it using existing operations.

The thing that annoys me the most about arc's current type system is that if you tag something, it becomes an unusable vector according to all existing arc code, so you need to re-implement or extend any function that you actually want to support the new type.



2 points by akkartik 4847 days ago | link

Hmm, it sounds like just making it a tagged list instead of a tagged vector wouldn't address your criticism. Any other suggestions?

-----

1 point by evanrmurphy 4847 days ago | link

I think he made the additional change of delegating all functional calls to the "parent" type when they didn't explicitly handle the type at hand. This makes a lot of sense. If you have a list that's tagged 'foo, it should behave exactly like a normal list does until you've specified some diverging behavior for type 'foo.

Do you still have the code for your experiment, shader?

-----

1 point by shader 4845 days ago | link

I do, but it was built on the old anarki master, so I'm going to have to spend a little bit of time updating it.

-----

1 point by akkartik 4847 days ago | link

Ah, I didn't properly read that first para somehow!

-----