table constructor syntax

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

table constructor syntax

fschmidt
Administrator
I am thinking of making table constructor syntax more like statements.  The change would be making end-of-line a separator and allowing empty elements.  So then this is legal and produces an empty table:
{,,,,,,}
Using end-of-line separators:
	return M.new{
		id = doc.id
		category_id = doc.topic_category_id
		order = doc.topic_order
		question = doc.question
		answer = doc.answer
	}
The other change would be requiring each element to be on one line just like statements.  So this would be illegal:
{
	one
		= 1
}
We can discuss this tonight.
Woe to those who call bad good and good bad -- Isaiah 5:20
Following the Old Testament, not evil modern culture
Reply | Threaded
Open this post in threaded view
|

Re: table constructor syntax

fschmidt
Administrator
done, closing
Woe to those who call bad good and good bad -- Isaiah 5:20
Following the Old Testament, not evil modern culture