Page 1 of 1

forgetting a comma when definining a Map results in strings

Posted: 12 Aug 2023, 21:49
by 20170201225639
This definition of a map,

Code: Select all

obj := Map(
	3, 4
	12, 2
	12, 58
)
actually succeeds in defining a Map with a Count of 2, mapping 3 to "412" and mapping "212" to 58.

I'm sure this behavior is intended, but:
1. I'm wondering which section of the docs contain materials relevant for deducing this behavior (I skimmed continuation sections but couldn't see anything directly relevant)
2. I also wonder whether if it's not more intuitive to just throw an error about the lack of commas. The current behavior turn what are almost certainly typos into something meaningful but unintended.

Re: forgetting a comma when definining a Map results in strings

Posted: 13 Aug 2023, 02:45
by just me

Re: forgetting a comma when definining a Map results in strings  Topic is solved

Posted: 13 Aug 2023, 19:37
by lexikos
Auto-concat

Obviously, you are expecting the lines to be combined. This is the same:

Code: Select all

obj := Map(	3, 4	12, 2	12, 58)

Re: forgetting a comma when definining a Map results in strings

Posted: 13 Aug 2023, 21:40
by 20170201225639
Thanks for the pointers, just me and lexicos!