I think 'unless' with 'or' might be what you're looking for.

(unless
  (or
    (cond1 ...)
    (cond2 ...)
    (cond3 ...))
  (call1 ...)
  (call2 ...))

'or' is short-circuited, so the conditions will be evaluated in order. If
one of the conditions is true, NIL will be returned. All the calls will be
executed if the conditions are false, and the value of the last call will
be returned.

On Thu, Jan 19, 2017 at 10:05 AM, dean <deangwillia...@gmail.com> wrote:

> Hi Alex
> Thank you for confirming no return and the alternative.
> Best Regards
> Dean
>
> On 19 January 2017 at 14:44, Alexander Burger <a...@software-lab.de
> <abu@software-labde>> wrote:
>
>> Hi Dean,
>>
>> > I'd like to do this but am not sure if it's possible
>> >
>> > ( case <whatever>
>> >    #========= start of match clause
>> >    (<some match>
>> >        (prog
>> >            (if (<some test is T>) (EXIT THIS MATCH CLAUSE/PROG))
>> >            (otherwise you'll execute this statement)
>> >        )
>> >   )
>> >   #========= end of match clause
>> >   .
>> >   .
>> >   .
>> > I also wonder if there's a similar... (if (T) (EXIT FUNCTION))
>>
>> If I understand you right, you are looking for an exit out of a nested
>> expression, like a 'return' statment in C or Java.
>>
>> Such a return does not exist, there is catch/throw for that
>>
>>    (catch 'something
>>       (for (..)
>>          (if (..)
>>             (throw 'something)
>>             (elseStuff)
>>             ..
>>
>> Catch/throw is more general then 'return', but the latter can be emulated
>> with
>> it.
>>
>> ♪♫ Alex
>> --
>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>>
>
>


-- 
John Duncan

Reply via email to