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

rebis-dev: Unexpected round brackets for characters '2' and '3' #1192

Closed
triska opened this issue Jan 10, 2022 · 6 comments
Closed

rebis-dev: Unexpected round brackets for characters '2' and '3' #1192

triska opened this issue Jan 10, 2022 · 6 comments

Comments

@triska
Copy link
Contributor

triska commented Jan 10, 2022

With the rebis-dev branch, I get:

?- C = '1'.
   C = '1'.   % expected
?- C = '2'.
   C = ('2'). % unexpected (expected: '2')
?- C = '3'.
   C = ('3'). % unexpected (expected: '3')
?- C = '4'.
   C = '4'.   % expected
?- C = '5'.
   C = '5'.   % expected
@UWN
Copy link

UWN commented Jan 10, 2022

And I get:

?- member(C,"0123456789").
   C = '0'
;  C = '1'
;  C = '2'
;  C = '3'
;  C = '4'
;  C = '5'
;  C = '6'
;  C = '7'
;  C = ('8')
;  C = '9'
;  false.
?- end_of_file.
ulrich@p0:/opt/gupu/scryer-prolog$ git describe
v0.8.123-805-gbcacb49

@josd
Copy link
Contributor

josd commented Jan 10, 2022

It looks non-deterministic:

$ scryer-prolog
?- use_module(library(lists)).
   true.
?- member(C,"0123456789").
   C = '0'
;  C = ('1')
;  C = '2'
;  C = '3'
;  C = ('4')
;  C = ('5')
;  C = '6'
;  C = '7'
;  C = '8'
;  C = '9'
;  false.
?-

@triska
Copy link
Contributor Author

triska commented Jan 11, 2022

This works as expected now, thank you a lot!

I hope that internally, characters will simply be treated as atoms (of length 1) in the future of rebis-dev?

@triska triska closed this as completed Jan 11, 2022
@mthom
Copy link
Owner

mthom commented Jan 11, 2022

I hope that internally, characters will simply be treated as atoms (of length 1) in the future of rebis-dev?

Yes, that's one case covered by the planned short atom optimization.

@UWN
Copy link

UWN commented Jan 11, 2022

... And that "abc" = [A|As] does not involve any lookup in an atom table?

@mthom
Copy link
Owner

mthom commented Jan 11, 2022

Right.

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

4 participants