I was looking at Rosetta Code today and happened upon the Quine task, which inspired me to try to write one in ViviFire. I decided to use some features that I've considered but haven't yet implemented in the parser. If you all find this syntax agreeable, I'll probably add support in the next EXE release.

Implicit dimensioning and initialization of arrays by using a list of elements inside curly braces

String constants by ASCII code/Unicode offset by preceding a number with a dollar sign, including all number bases (e.g. $42, $H2A, $O52, $B101010).

Similarly, string constants by (abbreviated) name, such as the $NL above which represents the platform-dependent newline character/sequence.

Semantically, the above code implies that the #Null object has a default method that sends a string to some output buffer such as stderr or a debugger's output window. I'm also considering naming this #Debug instead.

I would definitely change the #Null to #Debug though as I always think of the null character when I see something like #Null. #Debug would help to ensure that the user knows whatever comes afterward will be sent to an output of some kind. I assume you'll automatically detect if a (the) debugger is open and send it to that; otherwise I think you may need another variable to tell the language where the output is to be sent.

Thanks for the comments. I just added support for the mentioned constructs. But then I discovered that my example has a syntax error.

The second line begins #null a$(0), which is parsed as a normal method call rather than the expected anonymous method call. After this, the parser expects a line break, but finds a + instead, causing the "oh so helpful" error -- line 2 col 12: this symbol not expected in Newline. I probably should do something about that.

What I still see as strange is the missing closing curly brace in the first line of code.
If this is the supported syntax, it is fully on the contrary to what one is used from other languages utilizing curly braces._________________Stefan

Stefan, the closing curly brace is represented by $125 which translates into LB as Chr$(125). The second line cannot contain any quotes, otherwise they'd need to be escaped in the first line. This makes the code simpler._________________Brent

You can post new topics in this forumYou can reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum