Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add strings to Monicelli #19

Open
mfortini opened this issue Dec 16, 2014 · 8 comments
Open

Add strings to Monicelli #19

mfortini opened this issue Dec 16, 2014 · 8 comments

Comments

@mfortini
Copy link

I defined a conte Mascetti variable, but I don't know how to assign to it

@esseks
Copy link
Owner

esseks commented Dec 16, 2014

Simple answer: for now you can't.

As you might have noticed, pointers can be declared using conte. Parsing and emitting support is already in place, but this feature is not documented for a good reason: it's not usable yet. In fact, we still miss a way to use the corresponding & operator. We also miss a way to declare string literals, but I guess that would be pretty easy to solve, since double quotes " could be ok.

Additionally, I would like to introduce a true string type modeled on C++ std::string, instead of ol' C pointers to char arrays. This is certainly something I look forward to implementing and it's already on the way.

@mfortini
Copy link
Author

Yes I saw char * are not initialized in any way, so any interaction results to a segfault.
Perhaps we could find some start/end tags which are not double quotes to avoid spoiling a supercazzola, something like

voglio ciao, conte Mascetti come dire ciao mondo e basta
voglio ciao, conte Mascetti pensava ciao mondo altresì

thank you for Monicelli, it's very fun!

@esseks esseks self-assigned this Dec 16, 2014
@mikyt
Copy link

mikyt commented Mar 5, 2015

Hi esseks, Michele here.
As one of the authors of the original specification, allow me to say: great job on the implementation! After a couple of years, finally seeing Monicelli actually run is awesome!

Coming back on topic: for & I would suggest "mi porga l'indice". It's used in the first supercazzola of the movie, and it's quite apt for something returning the memory index of the variable. ;-)

And, for quoting the string, instead of using the usual double quotes, we can remember "quintana, o setta", from the scene of the supercazzola in the cemetery, and use "quintana," as the opening token, and ", o setta" as the closing one (please, note the double comma, making the final sentence look much better)

So, an example would be:
char *antani = "ciao mondo"
equivalent to:
voglio antani, conte Mascetti come se fosse quintana, ciao mondo, o setta

What do you think of it?

@esseks
Copy link
Owner

esseks commented Mar 10, 2015

Hi @mikyt! The quintana/setta way of defining strings is great! Consider it already in the backlog.

As of the mi porga l'indice, mi porga <varname> is already used to read a variable from the user, unfortunately. Granted, the latter is a statement while the former is an expression, so it could work without ambiguities (since "free" expressions are not allowed in Monicelli), but I'd rather avoid using the same token for two unrelated things.

@mikyt
Copy link

mikyt commented Mar 14, 2015

Cool for the strings!
About the other: yes, I know that it is already used, but I was relying exactly on what you just wrote. But I understand you preferring to keep them separate.

@giampiero7
Copy link

I start apologizing about this comment. It's gonna be really annoying, but I have to say it ;P
It's about "quintana," and ", o setta": I know the double comma is great to delimit the string itself, but a comma before a conjunction (", o") is not grammatically correct.
Please don't kill me about this... I just had to say it... I will accept your decision about it anyway ;)

By the way, AMAZING WORK!

@esseks esseks changed the title How to define strings? Add strings to Monicelli Jun 24, 2019
@esseks esseks added proposal and removed question labels Jun 24, 2019
@EnlitHamster
Copy link

Hello, I am trying Monicelli out for the first time, and as I cannot find it in the README.md, and this issue is still open, I suppose strings are not yet implemented, right?

@Riteo
Copy link

Riteo commented Feb 9, 2023

What's the status of this feature? This is literally the only thing stopping me from actually playing with this language.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants