Unexpected behaviour due to order of definitions

16 vues
Accéder directement au premier message non lu

Liam Goodacre

non lue,
28 janv. 2012, 21:51:4528/01/2012
à last...@googlegroups.com
Using the following declarations:

range(X)(Y) = if X<Y then [X...range(X+1)(Y)] else []
range(X) = range(0)(X)

step([]) = []
step([H...T]) = if T!=[] then [H,step(T)] else [H]

Depending on which is declared first, here are my findings:

Range defined before Step (expected behaviour):
step(range(5))
-> [0, [1, [2, [3, [4]]]]]

Range defined after Step (unexpected behaviour):
step(range(5))
-> step ([0...[1...[2...[3...[4]]]]])

 

Ian Clarke

non lue,
29 janv. 2012, 11:06:3329/01/2012
à last...@googlegroups.com
Liam,

I can't seem to reproduce it - does this happen consistently for you?

Ian.


 

--
You received this message because you are subscribed to the LastCalc Group
http://groups.google.com/group/lastcalc?hl=en?hl=en



--
Ian Clarke

Liam Goodacre

non lue,
29 janv. 2012, 11:17:0429/01/2012
à last...@googlegroups.com
I don't seem to be able to reproduce the error.

I was editing in a page that I'd be working on for a while, potentially a different error may have caused this.
I'll keep on the look out for unexpected behaviour.

Liam

Ian Clarke

non lue,
29 janv. 2012, 11:38:0529/01/2012
à last...@googlegroups.com
Thanks Liam.

Ian.

--
You received this message because you are subscribed to the LastCalc Group
http://groups.google.com/group/lastcalc?hl=en?hl=en
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message