git-class | a simple git wrapper to capture output
kandi X-RAY | git-class Summary
kandi X-RAY | git-class Summary
To install this module, run the following commands:. Copyright (C) 2009 Kenichi Ishigaki. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of git-class
git-class Key Features
git-class Examples and Code Snippets
Community Discussions
Trending Discussions on git-class
QUESTION
In Prolog, there are traditionally two ways of representing a sequence of characters:
- As a list of chars, which are atoms of length 1.
- As a list of codes, which are just integers. The integers are to be interpreted as codepoints, but the convention to be applied is left unspecified. As a (eminently sane) example, in SWI-Prolog, the space of codepoints is Unicode (thus, roughly, the codepoint-integers range from 0 and 0x10FFFF).
DCGs, a notational way of writing left-to-right list processing code, are designed to perfom parsing on "lists of exploded text". Depending on preference, the lists to-be-handled can be lists of chars or lists of codes. However, the notation for char/code processing differs when writing down the constants. Does one generally write the DCG in "char style" or "code style"? Or maybe even in char/code style for portability in case of modules exporting DCG nonterminals?
Some Research The following notations can be used to express constants in DCGs'a'
: A char (as usual: single quotes indicate an atom, and they can be left out if the token starts with a lowercase letter.)0'a
: the code ofa
.['a','b']
: A list of char.[ 0'a, 0'b ]
: A list of codes, namely the codes fora
andb
(so you can avoid typing in the actual codepoint values)."a"
a list of codes. Traditionally, a double-quoted string is exploded into a list of codes, and this notation also works SWI-Prolog in DCG contexts, even though SWI-Prolog maps a "double-quoted string" to the special string datatype otherwise.`0123`
. Traditonally, text within back-quotes is mapped to an atom (I think, the 95 ISO Standard just avoids being specific regarding the meaning of a back-quoted string. "It would be a valid extension of this part of ISO/IEC 13211 to define a back quoted string as denoting a character string constant."). In SWI-Prolog, text within back-quotes is exploded into a list of codes unless the flagback_quotes
has been set to demand a different behaviour.
Trying to recognize "any digit" in "char style" and make its "char representation" available in C
:
ANSWER
Answered 2021-Feb-21 at 21:37The Prolog Standard (6.3.7) says:
A double quoted list is either an atom (6.3.1.3) or a list (6.3.5).
Consequently, the following should succeed:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install git-class
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page