lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I would be totally happy with just '->' to pass one result.
The colon operator passes also just one value and this is the inspiration.

By imagination to write code with this feature I discovered for myself
that it would be also useful for many cases to pass two values.

The version with '-->' was immediately rejected because '--' is for comments.
I did not found the right way. A friend suggested finally to use '=>‘ for the two
values use case and I really like this idea.

I imagined for three values =->, four value ==> and so on. Yeah it would be
nice, but I have problems to find many situations where I need it.


> Am 04.07.2017 um 19:06 schrieb Sean Conner <sean@conman.org>:
> 
> It was thus said that the Great Kenneth Lorber once stated:
>> 
>>> On Jul 4, 2017, at 7:00 AM, lua-l-request@lists.lua.org wrote:
>>> 
>>> Re: Proposal: Lua should have arrow operators
>> 
>> I almost hate to point this out but ...
>> 
>> The proposed syntax 
>> 	->	pass one result
>> 	=>	pass two results
>> isn't a good match to Lua syntax and arbitrarily only handles 2 cases.  What if you need to pass three results?
>> 
>> We have precedent in the long string/long comment syntax, so I hesitantly bring up:
>> 	=>  pass one result
>> 	==> pass two results
>> 	===> pass three results
>> and so on for as many results as required.
> 
>  Nah.  You have:
> 
> 	->	one result
> 
> 	=>	two results
> 	-->
> 
> 	=->	three results
> 	-=>
> 	--->
> 
> 	==>	four results
> 	=-->
> 	--=>
> 	---->
> 
> 	==->	five results
> 	=-=>
> 	-==>
> 	----->
> 
>  And so on.  But wait?  What if you don't know the number?  Hmm ... 
> 
> 	...>	nope, probably hard to parse
> 	*>	hmm ... eh ..
> 	@>	easy to parse, but no mnemonic meaning and it looks wierd
> 	~>	could work ...
> 
>  -spc