Here's the original "setq" method

      (dm ln_completes> (Ln Ln_no)
         (if (gt0 (: first_ln_no))
            (setq Ln (pack " " Ln)))
         (if (<> (: new_buf) NIL)
            (=: buf (: new_buf))
            (=: buf (: hdngs)))
         (if (member Ln (: buf))
            (prog
               (if (gt0 (: first_ln_no))
                  (setq Res (: first_ln_no))
                  (setq Res Ln_no))
               (reset> This)
               (setq Res Res))
            (prog #not a member
               (=: new_buf (fltr_mtchng_hdng_rmndrs Ln))
               (if (<> (: new_buf) NIL)
                  (if (=0 (: first_ln_no))
                     (=: first_ln_no Ln_no))
                  (reset> This))
               (setq Res 0))))

On 31 January 2017 at 16:35, dean <deangwillia...@gmail.com> wrote:

> Any help advising how I should restructure the parens in order to replace
> setq with let would really help me to understand how to do it.
> Thank you in anticipation and sorry if this is a really easy thing to do.
>
> On 31 January 2017 at 16:32, dean <deangwillia...@gmail.com> wrote:
>
>> I've inadvertently pressed some send key combo again...
>>
>> simple use of let is fine e.g.
>> (let X 3
>>    do what ever you want to do with X here without much change of hierachy
>> )
>>
>> Ln doesn't fit this usage pattern and to "let" it be something at the top
>> seems somewhat artificial because there's an if statement deciding whether
>> to change it's supplied value or not.
>>
>>
>>
>> On 31 January 2017 at 16:29, dean <deangwillia...@gmail.com> wrote:
>>
>>> Oops acccidentally sent before I finished...Sorry!
>>>
>>> I was going to say the examples I've seen tend to be....
>>> (let X 3
>>>
>>>
>>>
>>>
>>>
>>>    (dm ln_completes> (Ln Ln_no)
>>>       (let (Ln Ln Res 0)
>>>          (if (gt0 (: first_ln_no))
>>>             (let Ln (pack " " Ln)))
>>>          (if (<> (: new_buf) NIL)
>>>             (=: buf (: new_buf))
>>>             (=: buf (: hdngs)))
>>>          (if (member Ln (: buf))
>>>             (prog
>>>                (if (gt0 (: first_ln_no))
>>>                   (let Res (: first_ln_no))
>>>                   (let Res Ln_no))
>>>                (reset> This)
>>>                (let Res Res))
>>>             (prog #not a member
>>>                (=: new_buf (fltr_mtchng_hdng_rmndrs Ln))
>>>                (if (<> (: new_buf) NIL)
>>>                   (if (=0 (: first_ln_no))
>>>                      (=: first_ln_no Ln_no))
>>>                   (reset> This))
>>>                (let Res 0)))))
>>>
>>> On 31 January 2017 at 16:27, dean <deangwillia...@gmail.com> wrote:
>>>
>>>> Each one of the "let"s in the following method WAS a setq. All I did
>>>> was wrap the existing body with parens and assign Ln and Res with "let" but
>>>> it doesn't work. The examples I've seen tend to be like this...
>>>> (let X 3
>>>>
>>>> )
>>>>
>>>>
>>>>
>>>>
>>>> )
>>>>
>>>>
>>>> On 30 January 2017 at 16:19, dean <deangwillia...@gmail.com> wrote:
>>>>
>>>>> Hi Alex
>>>>> Yes that worked great preceded by a test....i.e. whizzing through all
>>>>> file lines in the input file until almost the 4000th which triggered
>>>>> reporting on the method of interests's input and output. Thank you very
>>>>> much for the advice.
>>>>> Best Regards
>>>>> Dean
>>>>>
>>>>> On 30 January 2017 at 11:07, Alexander Burger <a...@software-lab.de>
>>>>> wrote:
>>>>>
>>>>>> Hi Dean,
>>>>>>
>>>>>> > trace operates in debug mode but again am not exactly sure how to
>>>>>> ensure
>>>>>> > that I am in debug mode on a method (rather than a function which
>>>>>> is just
>>>>>> > (debug 'Fn) at that point.
>>>>>> > I have tried but get can't trace.
>>>>>>
>>>>>> While (trace 'foo) traces a function, (trace 'meth> '+Class) traces a
>>>>>> method.
>>>>>>
>>>>>> ♪♫ Alex
>>>>>> --
>>>>>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>

Reply via email to