Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.forth Subject: Re: Strings and numbers Date: Fri, 11 Sep 2015 15:53:59 -0700 Organization: A noiseless patient Spider Lines: 18 Message-ID: <87k2rwsh2w.fsf@jester.gateway.pace.com> References: <87egjjk8kn.fsf@jester.gateway.sonic.net> <877fo0t4y0.fsf@jester.gateway.pace.com> <99b72d58-0b1a-4e09-9c34-42ebb844fff8@googlegroups.com> <87oah9st2o.fsf@jester.gateway.pace.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="3a9ed331cf606b0b072b7def4034f06f"; logging-data="5008"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+rcjFoc7by4x0zyTzHpbnY" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:y8t1FJV04GHQqBrxYKgQ0Tn4RJU= sha1:6Oi6HOtkTXzjq8Rqzn7sImC07LU= Xref: csiph.com comp.lang.forth:41962 Richard Todd writes: > using an exception for returning a normal value is another kind of > smell, is it not? I actually don't know, and will defer to the Forth gurus about that (I'm far from one). It's idiomatic in Lisp to use catch/throw that way, so I went with it. It's frowned on in Java but I think that's because Java exceptions are slow and heavy. I haven't studied how catch/throw is implemented in Forth but I'm imagining it to be a setjmp/longjmp style mechanism where the catch handlers are linked through the R stack, with the innermost one remembered in a static cell, and the handler mostly just restores the old DP and RP. So if it works that way, it should be lightweight and fast. > I made a pass through it to clean it up. It's basically the same > backtracking search, OK, I'll take a look later.