Re: pbr vs multiple returns

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

Jason Gade wrote:
> 
> I don't understand linking two separate concepts (pass by reference and 
> multiple returns). Can you explain a little better how they are related?

Just two different techniques that can both be used to implement a generic pop
function that does two things, ie get top and modify stack.

Is that any clearer?

I have a gut feeling that multiple returns will prove much easier to implement
than pbr, and now I think of it, there seems little to stop
top=pop(*stack)

from being nothing more than syntactic sugar for
{top,stack}=pop(stack)


Regards,
Pete

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

Search



Quick Links

User menu

Not signed in.

Misc Menu