Closed Gundolf68 closed 3 years ago
Thanks for the compliments!
If I recall, I believe it was mostly because I didn't want to have to add a char
type, and perhaps partly because Jinx is a fairly high level language, and I didn't see a real demand for it. Thinking a bit more about it, I could support this sort of operation by having the index operator returns a string containing a single character, which would still satisfy the intent of the operation.
If you feel it would be useful to you, let me know, and I'll consider adding support. I don't foresee it being difficult to do.
If you feel it would be useful to you, let me know, and I'll consider adding support. I don't foresee it being difficult to do.
Many thanks for the offer: I myself don't need this feature at the moment, but I think this would make Jinx a bit more complete and consistent.
One more question: If I run this code
import core
function the sum of {a} and {b}
return a + b
end
set x to the sum of 4 and 5
write line x
I get "Error at line 8, column 1: Expected operand". It seems that the "and" in the function signature doesn't work as expected. Shouldn't the precedence of the function call be higher than that of the "and" operator?
Issue has been fixed in development branch. I've also added index operator support for strings.
Thank you very much!
I am so excited about Jinx that I have started writing a Jinx2Lua-Transpiler : )
Interesting. Best of luck with that. Although a very different language, Jinx definitely has taken some inspiration from Lua.
Hi,
first of all my congratulations for this really cool scripting language - especially the function declarations and the multi word variables: I have never seen anything like this before.
My question is: How to access the content of a string? Something like this: