L::set as array?

Now we can use l::set like this:

l::set( 'string1', 'This' );
l::set( 'string2', 'Awesome' );
l::set( 'string3', 'Translation' );

I think it would be easier to have l::set to also accept an array?

l::set( array(
	'string1', 'This',
	'string2', 'Awesome',
	'string3', 'Translation',
));

What do you think?

Yes, absolutely :+1:

It already supports exactly the syntax you proposed. :smiley:

Does it? If so, awesome! Add it to the docs?

It is implemented and it works for me. Does it for you as well?

Yes, that’s currently missing in the docs. Added to the list. :slight_smile:

That’s what I thought as well but when I tested it in the Langkit, it didn’t.

Did not have the time to try it out just yet but it will probably work. (Need to fix panic issues on Splitview for Mac first. Who uses Mac anyway ;))

It does work, in fact, I just copied @jenstornell code from above without thinking, which will not work, it should in fact be a proper associative array:

l::set( array(
	'string1' => 'This',
	'string2' => 'Awesome',
	'string3' => 'Translation',
));
1 Like

I meant it like you have written it. I very often do exactly that typo error for some reason.