Dear all,

i’ve implemented the changes with case-insensitive ns_sets, and they are 
working nicely.  These changes are highly backwards compatible, no changes were 
e.g. necessary for OpenACS.

The new version is still verbose, when e.g. a “get” or “update” operation 
happens on a case-insensitive set (e.g. HTTP headers) to ease fixing such cases 
also for older NaviServer versions, but that will go away for the release,

Below are the old and new man pages for “ns_set”, the new man page is mostly a 
rewrite.

   NaviServer 4.99: 
https://naviserver.sourceforge.io/4.99/naviserver/files/ns_set.html
   NaviServer 5: 
https://naviserver.sourceforge.io/5.0/naviserver/files/ns_set.html

There are more places, where case-insensitive ns_sets should be used (ADP 
parser for attributes since HTML attributes are case-insensitive, or 
query-results from SQL), but I have not investigated enough for these.

Inspired by the previous state of the documentation of ns_set, I addressed the 
long-standing issue, that in usage messages (when commands a called 
incorrectly), did not differentiate between literal command elements and 
placeholders. In the new version, placeholders are enclosed in slashes (/), 
making it evident which parts are variable inputs.

   OLD: ns_ip properties ipaddr
   NEW: ns_ip properties /ipaddr/

Similarly, the arguments of parameters in the usage messages were often not 
informative about possible values, which are now included were we have 
internally the information

   OLD: ns_getcookie ?-all all? ?-include_set_cookies include_set_cookies? ?--? 
name ?default? 
   NEW: ns_getcookie ?-all true|false? ?-include_set_cookies true|false? ?--? 
/name/ ?default?

   OLD: ns_deletecookie ... ?-samesite samesite? … 
   NEW: ns_deletecookie ... ?-samesite strict|lax|none? …

For more details, see commit [1] . While i was at this area, i found many 
things in the documentation which should be fixed before the release. The goal 
for the release should be:

   1) all commands tested in the regression test should be documented
   2) all documented commands should be tested (at least syntax-tested)
   3) all implemented commands should be tested
   4) the parameters of the implemented commands should be documented and vice 
versa.
   5) deprecated commands should be listed in the deprecated section of the 
command listing in the documentation, but not advertised in the documentation

The state in previous releases (including AOLserver releases) is really not 
good. For example, we have commands documented which were removed at least 22 
years ago from NaviServer(AOLserver), such as 

     ns_db close
     ns_db open
 
I have already added over 50 new tests to the regression test suite to cover 
usage messages. However, based on a quick grep, there are still several hundred 
syntax tests missing. If we don't address1-5 now, before the release of the new 
major version, it's highly likely that we never will.

All the best.
-g

[1] 
https://github.com/naviserver-project/naviserver/commit/ffbd32774db1fe4a5b24a11b0032f144bec45cf7

> On 08.11.2024, at 17:35, Brian Fenton <brian.fen...@aimssoftware.ie> wrote:
> 
> This change sounds very welcome. I think we've all experienced the 
> frustration of case-insensitive searching.
> 
> One suggestion I have for the man page would be a beginner friendly example 
> of iterating through the contents of an ns_set e.g.
> 
> set headers [ns_conn headers]
> set output ""
> foreach {key value} [ns_set array $headers] {
>   append output "$key = $value \n"    
> }
> set output
> 
> I know we have ns_set print, but the first time I encountered sets an example 
> like the above would have been helpful.

_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to