On 20/08/2012, at 5:01 PM, Dobes Vandermeer wrote:

> 
> [Re: no blocks]
> 
> > Are you saying you cannot do
> >
> > fun foo() = {
> > if X then do
> >    return Y;
> > done
> > return Z;
> > }
> > ?
> 
> 
> No, of course you can do that. But the body of a function isn't a block.
> Nor is the do .. done part of the conditional a block. As in C,
> you can jump right into the middle of a do .. done. It's all straight
> line code.
>  
> I guess I don't know what you mean when you use the word "block".

In C, you can "return" from a block. You can jump out of a block.
You can break out of a block. yu can return out of a block
(from the enclosing function).

All a block does is reserve space on the stack for local
variables (which go out of scope at the end of a block).

you can also jump INTO a block in C and C++.
You cannot jump past an initialisation of a variable that's
in scope at the target label, but this applied in general.

You cannot do any of  those things in Felix procedures.
you cannot return, yield, break, or jump into a procedure
(except you can jump "back into" a procedure with a nonlocal
goto ;(

Felix should probably have blocks. Its on the "to do list".
It won't reserve any storage though. It will just be a scope
control.


--
john skaller
skal...@users.sourceforge.net
http://felix-lang.org




------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to