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

unchar() seems to be broken #1692

Closed
sshilovsky opened this issue Jul 2, 2016 · 3 comments
Closed

unchar() seems to be broken #1692

sshilovsky opened this issue Jul 2, 2016 · 3 comments
Assignees

Comments

@sshilovsky
Copy link

sshilovsky commented Jul 2, 2016

kos 0.20.1. log follows.

PRINT UNCHAR("A").
Failed to set scalar value.  Passed type Char, expected Double or Int
__________________________________________
           VERBOSE DESCRIPTION
Failed to set scalar value.  Passed type Char, expected Double or Int_________
_________________________________
__________________________________________
At interpreter history, line 24
PRINT UNCHAR("A").
             ^
@dewiniaid
Copy link

I thought I opened an issue for this myself but apparently not. I can confirm I've experienced the same issue.

This also means there is currently no means of case-sensitive string comparisons save for maybe some hackery involving a case-sensitive Lexicon. (Add both strings to new case-sensitive Lexicon, then check its length)

@Dunbaratu
Copy link
Member

I confirmed that this is still happening in our latest develop build.

I'm guessing this will be a simple one-line fix. Let me look at it.

@Dunbaratu Dunbaratu self-assigned this Jul 3, 2016
@Dunbaratu
Copy link
Member

Root cause of problem found:

ScalarValue.Create(foo) expects foo to be some kind of number type like int, float, double, etc.
But char is also an integer type - just a very short one, and ScalarValue.Create() doesn't have a case for that type.

I'd like to see ScalarValue.Create() cover more of the number types in the future, but for the time being I'll just cast the (char) to an (int) in Unchar() before calling it - just so we can get a fix to you quickly.

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

No branches or pull requests

3 participants