[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]

Re: questions about clasm



Hi Vesa and list!

In January, I wrote through private mail:
> 
> Vesa Kaihlavirta wrote:
> > Now, the question: Does there currently exist a way to a) break from a
> > running loop and b) exit completely from a running clasm-code? And if not,
> > should these be implemented as primitives?
> 
> They're not there, no. The question is _how_ to implement them, because
> we're using the Java stack. I'd say through Throwables, which are caught
> by the loop construct / by the caller of Clasm. I think we should have
> an abstract class extending Throwable: EarlyTermination (or
> ClasmEarlyTermination), which the others have to inherit from. Then, as
> you suggested, there would be primitives throwing these early terminations.
> 
> Does that sound reasonable?

Interestingly, I've found that Perl 6 will probably use the same
mechanism for control constructs as I've had in mind for both Clasm and
the clang I've designed before that, Archimedes. I've called these early
terminations and thought of exceptions as a special kind of early
termination; Larry Wall calls all of them exceptions and makes
exceptions used to implement control structures a special case, but
that's just terminology.

Incidentally, the article specifying that was published the same day I
wrote my reply to you, as cited above. ;-)

http://dev.perl.org/perl6/apocalypse/4

Later,
- Benja