Subscribe to this thread
Home - General / All posts - E is not a valid alias for a table in M9
Sloots

437 post(s)
#29-Nov-18 11:54

I have a simple query in M9 that joins two tables. I use an alias for both tables. To my surprise I got an error. I figured out it was caused by the fact that I used 'E' as an alias for one of the tables. When I changed it to another letter (e.g. 'Q') it worked as expected. With just one table (no join) the 'E' did not give errors.

Seems unwanted behaviour to me.


http://www.mppng.nl/manifold/pointlabeler

tjhb

8,410 post(s)
#29-Nov-18 12:59

Yes it's a trap--but a good one, with a valid reason.

E (e) is a defined constant (Euler's number, 2.71828...), therefore a keyword.

Avoid it, or enclose in [ ].

Sloots

437 post(s)
#29-Nov-18 17:36

Off course...


http://www.mppng.nl/manifold/pointlabeler

adamw


8,259 post(s)
#30-Nov-18 07:35

We are considering renaming some of the constants that we have: Pi -> NumPi, E -> NumE, Cr -> CharCr, Lf -> CharLf, CrLf -> CharCrLf, Whitespace -> CharWhitespace. For one thing, this would allow us to easier add to the list, ie, we'd like to add constants for quotes but adding Quote feels way more dangerous than adding CharQuote (easier with DQuote). The logic of using CharXxx instead of StringXxx is that StringXxx is for functions and CharXxx is for constants, however that's not something we feel strongly about and StringCr / StringLf / etc might be more logical.

tjhb

8,410 post(s)
#30-Nov-18 11:37

Another alternative: add Const prefix to all. I like that better. Focusses on usage not type; extensible ad hoc by user, as well as by adding built-in keywords.

Manifold User Community Use Agreement Copyright (C) 2007-2017 Manifold Software Limited. All rights reserved.