bugGNU Octave - Bugs: bug #52702, extra spaces in "char"...

 
 

bug #52702: extra spaces in "char" and "strvcat" docstring

Submitter:  None
Submitted:  Wed 20 Dec 2017 02:49:40 AM UTC
   
 
Category:  Documentation Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Documentation
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.2.1
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 21 Dec 2017 11:08:52 AM UTC, comment #6: 

Correct.  The number of spaces was shrunk, but still not enough.  I fixed that here: http://hg.savannah.gnu.org/hgweb/octave/rev/10c81c841b6f

Rik <rik5>
Group administrator
Thu 21 Dec 2017 04:49:25 AM UTC, comment #5: 

Thanks maintainers.
It seems that there is still one extra space in the example of function "char" docstring (in the file "libinterp/corefcn/strfns.cc" lines 71-77).
If this is not a mistake or it doesn't matter, please just ignore this comment.

Anonymous
Thu 21 Dec 2017 01:20:15 AM UTC, comment #4: 

Thanks for catchying these little inconsistencies.  I pushed your changes to the stable branch here (http://hg.savannah.gnu.org/hgweb/octave/rev/8354b505ad6b).  They will be a part of the 4.2.2 bug fix release.

Marking as fixed and closing report.

Rik <rik5>
Group administrator
Wed 20 Dec 2017 09:17:59 AM UTC, comment #3: 

Oh, the "Nan" has been fixed @ 22682:05308824fbcf
Please ignore comment #2

Anonymous
Wed 20 Dec 2017 07:07:46 AM UTC, comment #2: 

I'm not sure whether the following patch should be applied.
I search the document and find that only this place is "Nan", all others are "NaN".


--- /usr/share/octave/4.2.1/m/io/strread.m
+++ strread.m
@@ -174,7 +176,7 @@
 ##
 ## @table @asis
 ## @item last character = @qcode{"@xbackslashchar{}n"}
-## Data columns are padded with empty fields or Nan so that all columns have
+## Data columns are padded with empty fields or NaN so that all columns have
 ## equal length
 ##
 ## @item last character is not @qcode{"@xbackslashchar{}n"}


Anonymous
Wed 20 Dec 2017 06:30:56 AM UTC, comment #1: 

And the document of "strread.m" in page 84 of "octave.pdf" looks incorrect, which cannot be found in plain text displayed from "help strread".

Possible solution:

--- /usr/share/octave/4.2.1/m/io/strread.m
+++ strread.m
@@ -46,7 +46,9 @@
 ## @itemx %u
 ## The word is parsed as a number and converted to int32.
 ##
-## @item %*', '%*f', '%*s
+## @item  %*
+## @itemx %*f
+## @itemx %*s
 ## The word is skipped.
 ##
 ## For %s and %d, %f, %n, %u and the associated %*s @dots{} specifiers an


Anonymous
Wed 20 Dec 2017 02:49:40 AM UTC, original submission:  

Run the examples in the "char" and "strvcat" docstring:

octave:37>  char ([97, 98, 99], "", {"98", "99", 100}, "str1", ["ha", "lf"])
ans =

abc

98
99
d
str1
half

octave:38>  whos
Variables in the current scope:

   Attr Name        Size                     Bytes  Class
   ==== ====        ====                     =====  =====
        ans         7x4                         28  char

Total is 28 elements using 28 bytes

octave:39>  strvcat ([97, 98, 99], "", {"98", "99", 100}, "str1", ["ha", "lf"])
ans =

abc
98
99
d
str1
half

octave:40>  whos
Variables in the current scope:

   Attr Name        Size                     Bytes  Class
   ==== ====        ====                     =====  =====
        ans         6x4                         24  char

Total is 24 elements using 24 bytes



But the help text of "char" and "strvcat" says that

          char ([97, 98, 99], "", {"98", "99", 100}, "str1", ["ha", "lf"])
             => ["abc    "
                 "       "
                 "98     "
                 "99     "
                 "d      "
                 "str1   "
                 "half   "]

          strvcat ([97, 98, 99], "", {"98", "99", 100}, "str1", ["ha", "lf"])
                => ["abc    "
                    "98     "
                    "99     "
                    "d      "
                    "str1   "
                    "half   "]


which should be

          char ([97, 98, 99], "", {"98", "99", 100}, "str1", ["ha", "lf"])
             => ["abc "
                 "    "
                 "98  "
                 "99  "
                 "d   "
                 "str1"
                 "half"]

          strvcat ([97, 98, 99], "", {"98", "99", 100}, "str1", ["ha", "lf"])
                => ["abc "
                    "98  "
                    "99  "
                    "d   "
                    "str1"
                    "half"]


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-12-21 rik5 StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code