Ok here we are...
This is the nearest I can get in PL with my limited familarity i.e. a very
flat structure

(setq Pg_bks 7)
(setq Lns_from_top 6)
(setq Do_it T)
(case 2
   (1 (prinl "in 1"))
   (2
      (if (> 2 Pg_blks)      (setq Do_it NIL))
      (if (> 6 Lns_from_top) (setq Do_it NIL))
      (if (Do_it) (prinl "yes doing a"))
      (if (Do_it) (prinl "yes doing b"))
      (if (Do_it) (prinl "yes doing c")))


I'm really after this.
I like it because of the very flat structure, I can write the "stop" rules
in a very natural way and One objection stops any further execution. I have
had some very experienced programmers comment that this style is
ugly....Maybe but I find it very easy to understand/maintain.

#fn some_fn   or in lisp (prog......)
#   if cond1 then exit fn
#   if cond2 then exit fn
#   do a
#   do b
#   do c
#end fn

On 19 January 2017 at 14:01, dean <deangwillia...@gmail.com> wrote:

> Thank you very much Joe.,,,I see what you mean and don't think I've been
> clear enough.
> I'll try and put a better example together.
> It might be because of Lisps "everything returns a value" my constructs
> aren't compatible.
> We'll see....back soon.
>
> On 19 January 2017 at 13:13, Joe Bogner <joebog...@gmail.com> wrote:
>
>> dean, I would use unless.
>>
>> See this control structure below as an alternative to the prog/if
>>
>> : (setq Test1 1)
>> -> 1
>> : (case Test1 (1 (unless Test2 (prinl "true"))))
>> true
>> -> "true"
>>
>> : (setq Test2 "Nope")
>> -> "Nope"
>> : (case Test1 (1 (unless Test2 (prinl "true"))))
>> -> NIL
>>
>>
>>
>> On Thu, Jan 19, 2017 at 7:55 AM, dean <deangwillia...@gmail.com> wrote:
>>
>>> 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))
>>>
>>
>>
>

Reply via email to