-
Notifications
You must be signed in to change notification settings - Fork 123
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
Partial strings: not representable characters #267
Comments
Not sure, I think it should rather succeed with |
In the meantime it's:
Expected: Further:
Expected: |
@mthom : [bug] since it must be true
Counterexample: |
But also
is incorrect. |
@mthom , what is a terminator for |
I thought it was '\0'. The 0-byte. |
But in |
That's what I thought! I'm not sure how to reconcile the two. |
Not sure if it is possible, C-string have that issue. The terminator is the issue. Right now: pstr.append_chars("\x00ab") == None Why use a terminator? |
I think the general idea is that The catch is that no partial string (at least, none represented by
Eventually strings will be stored directly in the heap. The WAM needs to know when they terminate by scanning them since the length of the string won't be stored anywhere. That's not currently the case. Strings are currently stored to dedicated buffers pointed to from within the heap, and are deallocated via Rust's RAII. |
This comment seems to state that it isn't possible. If the length can't be stored then the terminator is required but it doesn't seem possible to distinguish a terminator and '\0'. When |
It's written to a second string, the tail of "\x0". |
|
OK, I have it done, according to the above interpretation. That is, a
I will commit the change and we can hopefully close the issue. |
The test cases work perfectly now, thank you a lot! |
However, I now incorrectly get: ?- Ls = "\x2124\". Ls = "\2124\". Expected answer: |
'\x0' instead of '\0' is acceptable, right? |
I suppose you mean Yes, absolutely! As I wanted to try the equivalence with GNU Prolog, I got: | ?- X = '\0\'. uncaught exception: error(syntax_error('user_input:9 (char:34) invalid character code in \\constant\\ sequence'),read_term/3) So, this seems to be a shortcoming in GNU Prolog... Definitely |
Not sure what you mean by shortcoming, but there is no requirement in 13211-1 that
|
I believe this should succeed, even if
Xs0
will not be a partial string.And the error should be rather a representation error.
The text was updated successfully, but these errors were encountered: