Re: Pass by Reference

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

Now I'm really confused. The naked stuff seems to make things implicit. It seems pretty explicit the way it is right now. I suspect I'm not getting what you're trying to say.

I think you're looking at it from the other direction. I'm referring to the return statement in the function, not the assignment. That is, if a function foo() is supposed to return 3 values, and I write:

s = foo() 

instead of:

{s} = foo() 

then the parser should return a compile error.

But as currently designed, there's no way the compiler can do this, because it doesn't know foo() is supposed to return multiple values.

I'm suggesting that in the same way a function will expect a certain number of parameters (and parameter counting is good), there should be a reciprocal feature if a function returns multiple values.

There's been no need for this in the past, because a function could only return a single value. In my mind, that's still the case, and we just have a nice way of "unwrapping" those parameters.

I'm suggesting making the number of values coming back from a function should be part of the language.

With the new syntax, it's not necessary, but I think it has value.

Did that make sense?

- David

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

Search



Quick Links

User menu

Not signed in.

Misc Menu