Unexpected behaviour due to order of definitions

16 views
Skip to first unread message

Liam Goodacre

unread,
Jan 28, 2012, 9:51:45 PM1/28/12
to 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

unread,
Jan 29, 2012, 11:06:33 AM1/29/12
to 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

unread,
Jan 29, 2012, 11:17:04 AM1/29/12
to 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

unread,
Jan 29, 2012, 11:38:05 AM1/29/12
to 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
Reply all
Reply to author
Forward
0 new messages