« Return to Thread: Re: if and while in SC

Re: if and while in SC

by stefan kersten-2 :: Rate this Message:

Reply to Author | View in Thread

On 28.06.2008, at 13:39, Dan Stowell wrote:

> 2008/6/28 stefan kersten <sk@...>:
>> On 28.06.2008, at 11:09, Dan Stowell wrote:
>>>
>>> Anyone disagree with the addition of something like this?
>>>
>>> + Boolean {
>>> while {
>>> ^"While was called with a fixed (unchanging) boolean as the  
>>> condition.
>>> Please supply a function instead.".error;
>>> }
>>> }
>>
>> actually i strongly disagree. people should be aware of the  
>> language's
>> evaluation and execution semantics. there is no such thing as an  
>> implicit
>> block with deferred evaluation as in C or java, and catching some  
>> special
>> cases makes things inconsistent, harder to understand and uglier  
>> (as in less
>> beautiful).
>
> What is inconsistent about this?

as has been noted before, 'while' expects an object as a test, that  
responds
with a Boolean when being sent the 'value' message. this 'protocol'  
would be
broken with your change, i.e. in a way a total function (which isn't  
total,
because not every object returns a Boolean, but that's a different  
story), is
made partial. that's what i'd consider inconsistent.

i think that detecting possible sources of infinite loops for some  
limited
number of special cases is a waste of time; instead the interpreter  
should be
made interruptible, so that programming errors don't lock up the whole
virtual machine and can be examined and fixed more easily.

just my 2 cents as always ;)

<sk>


_______________________________________________
sc-users mailing list


info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

 « Return to Thread: Re: if and while in SC

LightInTheBox - Buy quality products at wholesale price!