Closed bl1zzardx closed 8 months ago
I'd argue that this is not just a missing feature, but rather a bug in the earlier stages of the compilation. Imho unsupported operations should be handled before the actual compilation & execution (i.e., before the jitting) starts.
This can be regarded as a bug or as a feature ;-) As a developer I argue more for the latter because nobody implemented the feature "check if the generated instruction actually exists and print out a more meaningful error message". Now that I think of it I'd rather advise against checking while compiling to not slow down that process. Once something has crashed we'd have all the time we need to create a meaningful output.
missing string comparison hinders the usage of strings as script arguments for control flow switches
I added a small patch for initial support of the ==
operator for strings.
This should handle the use case of script argument strings for control flow switches @m-birke .
Examples:
a = "foo";
if (a == $b)
compare program string arguments
if ($a == $b)
string constant comparison
print("1" == "1");
Thanks for this patch @philipportner! I'm already using the string comparisons in the decision tree script now.
I am using the daphne-X86-64-v0.2 release. I tested the following:
print(1==1);
results in output1
.print("1"=="1");
results in an error: