Skip to content

Strings as lists of characters? #27

@triska

Description

@triska

Currently, I get:

[A,B] = "ab".
No results

For comparison, see how for example Scryer, Tau and Trealla Prolog interpret the string "ab":

?- [A,B] = "ab".
   A = a, B = b.

These Prolog systems treat double-quoted strings as lists of characters, which makes them extremely convenient to reason about, using common predicates over lists and also DCGs.

Note that internally, strings can still be represented extremely compactly (using UTF-8 encoding internally). Prolog code "sees" such strings as lists, even though they are much more compactly represented internally.

Do you have any plans to likewise make strings accessible as lists of characters? It would render your system extremely useful.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions