tact icon indicating copy to clipboard operation
tact copied to clipboard

Use of const String in receive parameter

Open 0kenx opened this issue 2 years ago • 8 comments

The following code should work:

const ConstMsg: String = "ABC";

receive(ConstMsg) {}

Currently it report error Syntax error: expected ":"

0kenx avatar Aug 07 '23 17:08 0kenx

Nevermind, I got it to work

0kenx avatar Aug 07 '23 17:08 0kenx

Reopened as this is indeed impossible

0kenx avatar Aug 08 '23 18:08 0kenx

impossible because you should not do

xsr avatar Aug 27 '23 21:08 xsr

What's the reason for that? It feels like completely natural semantics.

0kenx avatar Aug 28 '23 09:08 0kenx

reason I guess to do another N compiler passes, what's the problem to utilize any template processor and do such replaces if you want

moreover you are free to extend compiler and add this writer, why don't you try?

xsr avatar Aug 28 '23 09:08 xsr

look, the code you are writing running NOT WHILE COMPILING but on TVM, this is why you shouldn't even think 'cause it's broken design

xsr avatar Aug 28 '23 09:08 xsr

Of course I can preprocess. But I also want the language itself to have good properties. The compiler should just replace const string with its content first.

0kenx avatar Aug 28 '23 10:08 0kenx

no it should not you are wrong but let's stop the flame. you will not believe me and I remember when was just like you to waste more time on this

xsr avatar Aug 28 '23 10:08 xsr