octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #52785] some inconsistence in function 'lookup


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #52785] some inconsistence in function 'lookup' and 'logspace' help text
Date: Sat, 6 Jan 2018 18:20:23 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #7, bug #52785 (project octave):

Attached is a changeset making the change to how N is used.  It also removes
what looks like a duplicate test on some local variable.  I then saw a FIXME
in there about cruft related to case-insensitive greater-than and less-than
test, so I looked at the background of that and decided that can go.  The code
are fairly short routines that can be re-coded without too much thought, plus
JWE introduced the use of C++ classes five to eight years ago such that the
lexicographical comparisons are done deep within Array or its relatives.  So
either that lexicographic test would have to be done there, or a more local
solution would be to first convert 'table' and 'y' to upper or lower-case
before applying the lookup methods.

However, as regards to the actual use of case-insensitive code in the app, I
found the following references to the use of an 'i' option around 2010, and I
conclude this 'i' option isn't coming back:

http://lists.gnu.org/archive/cgi-bin/namazu.cgi?query=lookup+case+insensitive&submit=Search%21&idxname=octave-maintainers&max=20&result=normal&sort=score

http://lists.gnu.org/archive/html/octave-maintainers/2010-10/msg00134.html

http://hg.savannah.gnu.org/hgweb/octave/rev/30f54b3b9953

http://hg.savannah.gnu.org/hgweb/octave/rev/566249cf97fb

http://hg.savannah.gnu.org/hgweb/octave/rev/48cb431db87b

The main issue was that applying toupper or tolower inherently introduces a
scrambling of the 'table' strings which puts it in the "undefined behavior"
category.  So really, if a user is interested in case-insensitive analysis
s/he would be best using toupper and tolower and sorting prior to the lookup()
routine.

(file #42862)
    _______________________________________________________

Additional Item Attachment:

File name: octave-lookup_doc_change_code_cleanup-djs2017jan06.patch Size:4 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?52785>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]