Changeset 4492 for trunk/library

Show
Ignore:
Timestamp:
10/06/08 19:09:27 (3 months ago)
Author:
pmoura
Message:

Added predicates is_quote/1 and is_punctation/1 to the library entities "characterp" and "character".

Location:
trunk/library
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/library/character.lgt

    r3687 r4492  
    55 
    66    :- info([ 
    7         version is 1.0, 
     7        version is 1.1, 
    88        author is 'Paulo Moura', 
    9         date is 2000/7/24, 
     9        date is 2008/10/7, 
    1010        comment is 'Character predicates.']). 
    1111 
     
    6565 
    6666    is_layout(' '). 
     67    is_layout('\t'). 
     68    is_layout('\n'). 
     69 
     70    is_quote(''''). 
     71    is_quote('"'). 
     72    is_quote('`'). 
     73 
     74    is_punctation(','). 
     75    is_punctation(';'). 
     76    is_punctation(':'). 
     77    is_punctation('.'). 
     78    is_punctation('?'). 
     79    is_punctation('!'). 
    6780 
    6881    lower_upper(a, 'A'). 
  • trunk/library/characterp.lgt

    r3687 r4492  
    33 
    44    :- info([ 
    5         version is 1.0, 
     5        version is 1.1, 
    66        author is 'Paulo Moura', 
    7         date is 2000/7/24, 
     7        date is 2008/10/7, 
    88        comment is 'Character protocol.']). 
    99 
     
    1212    :- info(is_alphanumeric/1, [ 
    1313        comment is 'True if the argument is an alphanumeric character.', 
    14         argnames is ['Term']]). 
     14        argnames is ['Char']]). 
    1515 
    1616    :- public(is_alpha/1). 
     
    1818    :- info(is_alpha/1, [ 
    1919        comment is 'True if the argument is a letter or an underscore.', 
    20         argnames is ['Term']]). 
     20        argnames is ['Char']]). 
    2121 
    2222    :- public(is_letter/1). 
     
    2424    :- info(is_letter/1, [ 
    2525        comment is 'True if the argument is a letter.', 
    26         argnames is ['Term']]). 
     26        argnames is ['Char']]). 
    2727 
    2828    :- public(is_bin_digit/1). 
     
    3030    :- info(is_bin_digit/1, [ 
    3131        comment is 'True if the argument is a binary digit.', 
    32         argnames is ['Term']]). 
     32        argnames is ['Char']]). 
    3333 
    3434    :- public(is_octal_digit/1). 
     
    3636    :- info(is_octal_digit/1, [ 
    3737        comment is 'True if the argument is an octal digit.', 
    38         argnames is ['Term']]). 
     38        argnames is ['Char']]). 
    3939 
    4040    :- public(is_dec_digit/1). 
     
    4242    :- info(is_dec_digit/1, [ 
    4343        comment is 'True if the argument is a decimal digit.', 
    44         argnames is ['Term']]). 
     44        argnames is ['Char']]). 
    4545 
    4646    :- public(is_hex_digit/1). 
     
    4848    :- info(is_hex_digit/1, [ 
    4949        comment is 'True if the argument is an hexadecimal digit.', 
    50         argnames is ['Term']]). 
     50        argnames is ['Char']]). 
    5151 
    5252    :- public(is_lower_case/1). 
     
    5454    :- info(is_lower_case/1, [ 
    5555        comment is 'True if the argument is a lower case letter.', 
    56         argnames is ['Term']]). 
     56        argnames is ['Char']]). 
    5757 
    5858    :- public(is_upper_case/1). 
     
    6060    :- info(is_upper_case/1, [ 
    6161        comment is 'True if the argument is a upper case letter.', 
    62         argnames is ['Term']]). 
     62        argnames is ['Char']]). 
    6363 
    6464    :- public(is_vowel/1). 
     
    6666    :- info(is_vowel/1, [ 
    6767        comment is 'True if the argument is a vowel.', 
    68         argnames is ['Term']]). 
     68        argnames is ['Char']]). 
    6969 
    7070    :- public(is_layout/1). 
     
    7272    :- info(is_layout/1, [ 
    7373        comment is 'True if the argument is a layout character.', 
    74         argnames is ['Term']]). 
     74        argnames is ['Char']]). 
     75 
     76    :- public(is_quote/1). 
     77    :- mode(is_quote(+char), zero_or_one). 
     78    :- info(is_quote/1, [ 
     79        comment is 'True if the argument is a quote character.', 
     80        argnames is ['Char']]). 
     81 
     82    :- public(is_punctation/1). 
     83    :- mode(is_punctation(+char), zero_or_one). 
     84    :- info(is_punctation/1, [ 
     85        comment is 'True if the argument is a punctation character.', 
     86        argnames is ['Char']]). 
    7587 
    7688    :- public(lower_upper/2). 
     
    8092    :- info(lower_upper/2, [ 
    8193        comment is 'Converts between lower and upper case letters.', 
    82         argnames is ['Term1', 'Term2']]). 
     94        argnames is ['Char1', 'Char2']]). 
    8395 
    8496:- end_protocol.