Skip to content

Instantly share code, notes, and snippets.

@vito
Created December 14, 2010 00:29
Show Gist options
  • Save vito/739844 to your computer and use it in GitHub Desktop.
Save vito/739844 to your computer and use it in GitHub Desktop.
~~> x = reference to x
=> = direct value
before:
Reference (~~> Object { oDelegates => [Value], oMethods => (MethodMap, MethodMap) })
- match, comparePrecision, etc. need to use unsafePerformIO to check delegates,
or be locked into the IO monad
- @join:/@do: needed to be careful with the target's delegates; they would make a dummy
object that delegates to the original, and then merge new methods and delegates back into
the original when they're done, filtering out the additional delegates for arguments
and the block's contents
- delegates can be mutated
after:
Object { oDelegates => [Value], oMethods (~~> (MethodMap, MethodMap)) }
- match, comparePrecision, etc. can now check all delegation information purely!
- @join:do: just needs to evaluate with a toplevel object containing the original's
delegates as well as the block's context. this object uses the same method reference
as the target; any definitions are automatically inserted into it, no merging needed
- delegates cannot be mutated, but you can cheaply add them on a per-value basis
(@delegating-to: and @with-delegates:)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment