Re: "string is print" question



If I think that "print"able characters should include the newline
(physically a carriage return was in former times a newline), than I
should file a bug for "string is print" and an enhancement request for
its documentation, that it clarifies that the "print"able space class
is included, like alnum includes ascii.

I wouldn't ever think that the normal, common, old-fashioned "space"
is the only "space" class character accepted by the "print" class.
But we had just the discussion about extending "string trim(left|
right)?" to trim the whole UNICODE whitespace character set, which is
already recognized by "string is space".

No ... I don't think that I should file a bug against the
documentation. If the intention of "string is print" is to test
against "print"able characters, than "string is print" does not behave
right.

But ... what is really the intention of the "print" class?

Reading the "re_syntax" man page the "print" class is described as:

A "printable" (same as graph, except also including space).

So "graph" and "space" reference here other character classes.

Reading the "string is print" man page should be done the same or the
functionality should be the same ... including "space" character class
elements with the "print" character class, too!

Perhaps {1,} of the other core team members might clarify this
situation?

Best Regards,

Martin

On Sep 23, 4:21 pm, cla...@xxxxxxxxx (Cameron Laird) wrote:
In article <1771d827-e370-4359-999a-d7bc725db...@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>,



 <oak...@xxxxxxxxxxxxxxxxxxxx> wrote:
On Sep 23, 7:08 am, "MartinLemburg@Siemens-PLM"
<martin.lemburg.siemens-...@xxxxxxx> wrote:
Hello,

using "string is print" caused some unexpected trouble ...

    % string is print "Hello World!\nHallo Welt!"
    0
    % string is print "\n"
    0

This behaviour is unexpected, because the documentation tells about
the "print" class:

    "Any Unicode printing character, including space."

So ... "\n" is a space (string is space \"n" => 1), but "string print"
denies "\n" to be a space.

Shoud I file a bug?

Best regards,

Martin Lemburg

The way I interpret is that 'string is print' is any unicode printing
character and "*the* space character" not any unicode printing
character and "*any* space character".  Admittedly the documentation
could be slightly less confusing in this regard.

So we're agreeing that Martin should file a bug against the documentation?

.



Relevant Pages

  • Re: Comment on trim string function please
    ... I think you have a bug. ... but does it fly past the terminating null character? ... initial space scan) then this writes outside the string. ... ASIDE FROM THE CAST "ISSUES", ...
    (comp.lang.c)
  • Re: Unexpected regex Behavior
    ... wish to do special processing if any chunk ends with the carriage-return ... the "^" character is guaranteed to match only the beginning ... the "$" character only the end (or before the newline at ... the string contains only one line. ...
    (comp.lang.perl.misc)
  • Re: easy string formating question
    ... then write that string to a file. ... It may be a bit brute-force-ish, and there may be other more elegant ways that I don't know, but that list comprehension extracts pieces of "s" of size "size" and creates a list where each piece doesn't excede "size" characters. ... The jointhen just smashes them all together, joined with your requested "quotation-mark followed by newline" ...
    (comp.lang.python)
  • Re: bug in g95 ?
    ... > where test.dat contains the string: ... delimited text file exhibits the 'bug'. ... and to on text output, g95 does not do that here. ... is counted as a non white space character, ...
    (comp.lang.fortran)
  • Re: Unexpected regex Behavior
    ... wish to do special processing if any chunk ends with the carriage-return ... the "^" character is guaranteed to match only the beginning ... the "$" character only the end (or before the newline at ... the string contains only one line. ...
    (comp.lang.perl.misc)