lua-users home
lua-l archive

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


On 19 July 2018 at 21:44, dyngeccetor8 <dyngeccetor8@disroot.org> wrote:
> On 07/19/2018 04:14 AM, Soni "They/Them" L. wrote:
>> local with = require "with"
>>
>> local f = with ^ function(with, do_error)
>>   for x in with({close = function() print(4) end}) do
>>     for y in with({close = function() print(2) end}) do
>>       print(1)
>>     end
>>     print(3)
>>   end
>>   print(5)
>> end
>> ---
>>
>> and prints 1, 2, 3, 4, 5 in that order
>
> Reading your messages leaves me a feeling that I'm dumb and this is
> something outstanding, or that this is some complex way to print
> 1, 2, 3, 4, 5.

you're not dumb.  it's _very_ rare that code in itself, without any
hint of its purpose, can be an effective way of communication.



-- 
Javier