Thanks, I hadn't thought of it. I just tried and it didn't catch the bug
(which as Alex said,
is that I'm calling Mtx as a function, when it isn't). I think its because
the error happens
at runtime, when the data structure Mtx is created, instead of at "compile"
time when
the symbol 'animate is bound to the function definition. From the example
in the
documentation, lint seems to catch only the "compile" time bugs.

On Fri, Dec 9, 2016 at 1:17 AM, Joh-Tob Schäg <johtob...@gmail.com> wrote:

> Did you 'lint the source code? 'lint should warn you when you have T as
> Parameter in a function.
>
> 2016-12-09 5:51 GMT+01:00 Bruno Franco <brunofrancosala...@gmail.com>:
>
>> My my, I see it! Thanks Alex.
>>
>> On Thu, Dec 8, 2016 at 1:50 AM, Alexander Burger <a...@software-lab.de>
>> wrote:
>>
>>> Hi Bruno,
>>>
>>> > I've written something that redefines T to NIL, which surprises me
>>> > because I thought that T was protected from redefinition like that, and
>>> > I have not found a command in the code that looks like it is
>>> redefining T.
>>>
>>> It is true that 'T' is protected from simple, direct modifications like
>>>
>>>    : (set T 7)
>>>    !? (set T 7)
>>>    T -- Protected symbol
>>>
>>> but not from indirect, involved processings. PicoLisp always gives you
>>> enough
>>> power to shoot into your foot ;)
>>>
>>>
>>> > Could you check it out and see if its something in the code, or a bug
>>> in
>>> > the language?
>>>
>>> > # -> Mtx
>>> > (de animate (Mtx) # -> a matrix list (Mtx ..)
>>> > ...
>>> >       (actions (Mtx)) ) )
>>> > # (animate (mtx 4))
>>>
>>> The problem is that you call 'Mtx' as a function in (actions (Mtx)).
>>>
>>> The value of 'Mtx' is not a function
>>>
>>>    : (mtx 4)
>>>    -> ((T T T T) (NIL NIL NIL NIL) (NIL NIL NIL NIL) (NIL NIL NIL NIL))
>>>
>>> so what you end up doing is calling
>>>
>>>    '((T T T T) ...)
>>>
>>> which *looks* like a fuction but is not *meant* to be one. It binds 'T'
>>> as a
>>> formal parameter.
>>>
>>> ♪♫ Alex
>>> --
>>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>>>
>>
>>
>

Reply via email to