1. Redefining Builtins?

How do I redefine a built-In function, yet call it from the new one?

Thanks,
 Alex

new topic     » topic index » view message » categorize

2. Re: Redefining Builtins?

Alex Chamberlain wrote:
> 
> How do I redefine a built-In function, yet call it from the new one?
> 
> Thanks,
>  Alex

Just like this dude:
without warning

procedure print_(integer io, atom num)
    print(io, num)
end procedure

procedure print(integer io, sequence num)
    puts(io, num)
end procedure

print(1, "Hello World\n")
print_(1, 1234567890)

machine_proc(26, 0) -- wait_key

Make sure you wrap the original routine before redefining it.


Regards,
Vincent

new topic     » goto parent     » topic index » view message » categorize

3. Re: Redefining Builtins?

Chers thats great!

new topic     » goto parent     » topic index » view message » categorize

4. Re: Redefining Builtins?

Vincent wrote:
> 
> Alex Chamberlain wrote:
> > 
> > How do I redefine a built-In function, yet call it from the new one?
> > 
> > Thanks,
> >  Alex
> 
> Just like this dude:
> }}}
<eucode>
> without warning
> 
> procedure print_(integer io, atom num)
>     print(io, num)
> end procedure
> 
> procedure print(integer io, sequence num)
>     puts(io, num)
> end procedure
> 
> print(1, "Hello World\n")
> print_(1, 1234567890)
> 
> machine_proc(26, 0) -- wait_key
> </eucode>
{{{

> Make sure you wrap the original routine before redefining it.
> 

Or perhaps you're asking for this...
without warning

procedure print(integer io, sequence num)
    puts(io, num)
end procedure

procedure foo()
   print(1, "Hello World\n")
end procedure

foo()
machine_proc(26, 0) -- wait_key

I'm not sure exactly... tongue


Regards,
Vincent

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu