Revolution strange behaviour in function names... (Data Structure related)

Andre Garzia soapdog at mac.com
Fri Jul 9 01:16:44 EDT 2004


On Jul 9, 2004, at 1:54 AM, Dar Scott wrote:

Dar,

actually DS stands for Data Structure... since Rev already have a push 
function, I prefixed all functions with DS for they are the dsLib. I 
was just trying to implement this new and funny Quack data structure 
when my revolution engine was possessed by the devil! It even asked to 
RESET THE LICENSE!!!! Ithought, it might be a Rev 2.2 bug, I switched 
to 2.1 without success.. the code is simple, yet, from the message box, 
it fails all the time... Let me glue it. (oh, yes, it uses boxes.)

PS: the problem is not the code executing wrong, the code is simply not 
executing at all. Cons work, Car and Cdr too, but the other functions 
receive: "unknown handler" when I try at the message box... it's 
strange!!!

like trying:
cons(1, box(1)) into the message box is fine. but trying:

put cons(1, box(1)) into tB
put tB

does not work, the box is missing data.... it put only part of the box 
data... strange.


function cons a, b
   return box(a) & box(b)
end cons

function car c
   return boxContentsOf(c, 1)
end car

function cdr c
   return boxContentsOf(c, 2)
end cdr

function reverse_List theList

   put box(empty) into theAuxList
   put boxLength(theList)  into tBoxLgt


   repeat for tBoxLgt times
     put cons(car(theList), theAuxList) into theAuxList
     put cdr(theList) into theList

   end repeat
   return theAuxList
end reverse_List

on ds_push pElement, @pQueue
   put cons(pElement, pQueue) into pQueue
end ds_push

function ds_pop @pQueue
   put car(pQueue) into tElement
   put cdr(pQueue) into pQueue
   return tElement
end ds_pop






> I don't have any problem in a quick test.  Could you be using the 
> function as a command?  That wouldn't explain the other weird stuff.
>
> (If ds stands for Dar Scott, I might wonder about the notion of 
> ds_push(), myself.)
>
> Dar Scott
>
>
>
-- 
Andre Alves Garzia ð 2004 ð BRAZIL
http://studio.soapdog.org



More information about the use-livecode mailing list