This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Safe implementation based on the existential power of closures. | |
mod ClosureUniversal { | |
// A value of universal type is a pair of functions. store will | |
// write the underlying value into the associated tag, while clear | |
// will erase the data in the tag to prevent space leaks. | |
pub struct Univ { | |
priv store: @fn(), | |
priv clear: @fn() | |
} |
NewerOlder