Re: Help needed with walk_dir()

new topic     » goto parent     » topic index » view thread      » older message » newer message
hacker said...
PeteE said...

The routine_id is used as a sort of pointer-to-a-function...

... Having never learned C or lower-level stuff my understanding of pointers is hazy ...

You can think of routine ids as a kind of bookmark or place holder; its a way that you can call a routine when you don't know it's name.

In Euphoria, every routine is given a number when the application is run. You can find out what that number is by using the routine_id() function, and you can call the 'anonymous' routine by using it's number in the call_proc() or call_func() routine.

For example, the custom_sort function knows how to sort elements in a sequence but it doesn't know how to compare elements to work out which element should go before another element. Instead, it calls a routine that is written by you to get that information; but custom_sort does not know the name of your routine. So it calls your routine 'indirectly' using the call_func() routine with the routine id you initially passed to custom_sort().

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu