On 9/10/07, skaller <[EMAIL PROTECTED]> wrote:
> I'm thinking to make begin/end keywords. Begin/end mark a block,
> and are equivalent to { } sometimes, like Ocaml.
> do/done marks a loop or control structure *without* a scope,
> i.e. it's labels and gotos.
>
> So vaguely:
>
>         whilst c begin sts end;
> ==>     whilst c do { sts }; done;
>

Sure, makes sense. However, I think it'd be reasonable to consider if
we actually need do/done structures without scope. Lots of languages
don't have this construct.

> > I'm just not sure how we handle errors, though.
>
> What errors?
>
> If you make a programming error, and Felix detects it,
> Felix aborts. This is right IMHO. It's a bug. Fix it!
> Felix has a Zero Tolerance policy for bugs.
>
> So .. if you say 'open f' and f doesn't exist, Felix
> aborts, as it should.

I disagree. I think the runtime library should only bomb if it's
actually a fatal error. Something like a missing file or other
spurious errors *should* be handle-able.

> Otherwise use
>
>         let h = try_open f in match h with
>         | Failed => ...
>         | Handle h => ..
>         endmatch

Sure, except if you have to do a lot of kernel interactions, this gets
really ugly. To, say, change a directory tree's group and permissions,
would be very ugly and unwieldy.

> Felix does 'exceptions' with some messiness.
>
> [snip]
>
> Note that EH will be easier to do if we can ensure all
> functions throwing are converted to heaped procedures;
> unfortunately it's hard to tell if a closure (func or
> proc passed as a value) throws.. it would have to be
> made part of the type.

This would be doable if we put enough sugar into it. On the other
hand, monadic exceptions might be simpler. I need to read up on them.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to