You can subscribe to this list here.
2005 |
Jan
|
Feb
(53) |
Mar
(62) |
Apr
(88) |
May
(55) |
Jun
(204) |
Jul
(52) |
Aug
|
Sep
(1) |
Oct
(94) |
Nov
(15) |
Dec
(68) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(130) |
Feb
(105) |
Mar
(34) |
Apr
(61) |
May
(41) |
Jun
(92) |
Jul
(176) |
Aug
(102) |
Sep
(247) |
Oct
(69) |
Nov
(32) |
Dec
(140) |
2007 |
Jan
(58) |
Feb
(51) |
Mar
(11) |
Apr
(20) |
May
(34) |
Jun
(37) |
Jul
(18) |
Aug
(60) |
Sep
(41) |
Oct
(105) |
Nov
(19) |
Dec
(14) |
2008 |
Jan
(3) |
Feb
|
Mar
(7) |
Apr
(5) |
May
(123) |
Jun
(5) |
Jul
(1) |
Aug
(29) |
Sep
(15) |
Oct
(21) |
Nov
(51) |
Dec
(3) |
2009 |
Jan
|
Feb
(36) |
Mar
(29) |
Apr
|
May
|
Jun
(7) |
Jul
(4) |
Aug
|
Sep
(4) |
Oct
|
Nov
(13) |
Dec
|
2010 |
Jan
|
Feb
|
Mar
(9) |
Apr
(11) |
May
(16) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
(7) |
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
(92) |
Nov
(28) |
Dec
(16) |
2013 |
Jan
(9) |
Feb
(2) |
Mar
|
Apr
(4) |
May
(4) |
Jun
(6) |
Jul
(14) |
Aug
(12) |
Sep
(4) |
Oct
(13) |
Nov
(1) |
Dec
(6) |
2014 |
Jan
(23) |
Feb
(19) |
Mar
(10) |
Apr
(14) |
May
(11) |
Jun
(6) |
Jul
(11) |
Aug
(15) |
Sep
(41) |
Oct
(95) |
Nov
(23) |
Dec
(11) |
2015 |
Jan
(3) |
Feb
(9) |
Mar
(19) |
Apr
(3) |
May
(1) |
Jun
(3) |
Jul
(11) |
Aug
(1) |
Sep
(15) |
Oct
(5) |
Nov
(2) |
Dec
|
2016 |
Jan
(7) |
Feb
(11) |
Mar
(8) |
Apr
(1) |
May
(3) |
Jun
(17) |
Jul
(12) |
Aug
(3) |
Sep
(5) |
Oct
(19) |
Nov
(12) |
Dec
(6) |
2017 |
Jan
(30) |
Feb
(23) |
Mar
(12) |
Apr
(32) |
May
(27) |
Jun
(7) |
Jul
(13) |
Aug
(16) |
Sep
(6) |
Oct
(11) |
Nov
|
Dec
(12) |
2018 |
Jan
(1) |
Feb
(5) |
Mar
(6) |
Apr
(7) |
May
(23) |
Jun
(3) |
Jul
(2) |
Aug
(1) |
Sep
(6) |
Oct
(6) |
Nov
(10) |
Dec
(3) |
2019 |
Jan
(26) |
Feb
(15) |
Mar
(9) |
Apr
|
May
(8) |
Jun
(14) |
Jul
(10) |
Aug
(10) |
Sep
(4) |
Oct
(2) |
Nov
(20) |
Dec
(10) |
2020 |
Jan
(10) |
Feb
(14) |
Mar
(29) |
Apr
(11) |
May
(25) |
Jun
(21) |
Jul
(23) |
Aug
(12) |
Sep
(19) |
Oct
(6) |
Nov
(8) |
Dec
(12) |
2021 |
Jan
(29) |
Feb
(9) |
Mar
(8) |
Apr
(8) |
May
(2) |
Jun
(2) |
Jul
(9) |
Aug
(9) |
Sep
(3) |
Oct
(4) |
Nov
(12) |
Dec
(13) |
2022 |
Jan
(4) |
Feb
|
Mar
(4) |
Apr
(12) |
May
(15) |
Jun
(7) |
Jul
(10) |
Aug
(2) |
Sep
|
Oct
(1) |
Nov
(8) |
Dec
|
2023 |
Jan
(15) |
Feb
|
Mar
(23) |
Apr
(1) |
May
(2) |
Jun
(10) |
Jul
|
Aug
(22) |
Sep
(19) |
Oct
(2) |
Nov
(20) |
Dec
|
2024 |
Jan
(1) |
Feb
|
Mar
(16) |
Apr
(15) |
May
(6) |
Jun
(4) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(13) |
Nov
(18) |
Dec
(6) |
2025 |
Jan
(12) |
Feb
|
Mar
(2) |
Apr
(1) |
May
(11) |
Jun
(5) |
Jul
(4) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Bernd E. <eid...@we...> - 2008-03-05 10:03:51
|
> The NaviServer wiki has been defaced so bad by spammers that it is > unusable. We should consider turning off the self-registration feature - before undoing the changes, i don't think it's necessary on the Naviserver wiki... Bernd. |
From: Daniel S. <moo...@av...> - 2008-03-03 19:24:41
|
The NaviServer wiki has been defaced so bad by spammers that it is unusable. Daniel -- | --------------------------------------------------------------- | Daniel P. Stasinski | http://www.saidsimple.com | moo...@av... | http://www.disabilities-r-us.com | XMMP: moo...@av... | http://www.avenues.org | Google Talk: mooooooo | http://www.scriptkitties.com |
From: Neophytos D. <k2...@ph...> - 2008-01-08 12:11:47
|
Stephen Deasey wrote: > On Jan 7, 2008 10:00 AM, Neophytos Demetriou <neo...@ph...> wrote: >> I'm having the same problem as outlined below. >> >> Basically, the log fails to roll (and so does "ns_accesslog roll") >> eventhough the directory and the log file look good. > > > What messages appear in your error log when you try to roll a file? [-sched-] Notice: nslog: closed '/web/log/access.8000.log' [-sched-] Error: nslog: failed: roll '/web/log/access.8000.log': 'No such file or directory' > If it's to be rolled at midnight, whether it actually rolls or not > you'd expect to see a message from the sched thread. If you don't see > it, then log rolling is not enabled. log rolling is enabled, see error messages above and, also, configuration settings below: ns_param RollDay * ns_param RollFmt %Y-%m-%d-%H:%M ns_param RollHour 0 ns_param RollOnSignal On ns_param RollLog On > If you see that but the log does not actually roll, I would expect an > error message of some sort. Looking through the code for this last > time all error paths appear to be covered by log messages. see above > Re permissions, look at the permissions of both the log files and the > directory they're in. The server needs to have permission to create a > new file under it's run-time uid/gid -- whereas at startup it creates > the file as root. ls -la /web/log/ drwxrwxr-x 2 service-phgt-0 web 20480 Jan 8 07:50 . drwxrwxr-x 5 root web 4096 Nov 15 15:17 .. -rw-r--r-- 1 service-phgt-0 web 13514689 Jan 7 23:59 access.8000.log ps aux | grep nsd 1002 20781 2.3 6.7 491856 208840 ? Sl Jan07 32:03 /opt/naviserver-4.99.2-2008-01-07/bin/nsd -z -i -t /web/service-phgt-0/etc/nsd/config-main-8000.tcl -u service-phgt-0 -g web cat /etc/passwd | grep 1002 service-phgt-0:x:1002:407::/web/service-phgt-0:/bin/bash > Also, has log file rolling never worked for you? If this is something > new, what's changed recently? Never worked! >> Please note that "ns_rollfile" renames the existing log (say, >> access.log.000) but it does not create a new one (not sure if that is >> the expected behaviour). > > > That's expected. It is a low-level routine to handle the renaming. > ns_log roll and ns_accesslog roll call it and handle the reopening > themselves. If you use it to roll some other kind of file manually, > you'll have to take account of that. I use ns_logroll for the server/error log and rolling works fine. Thanks, Neophytos |
From: Stephen D. <sd...@gm...> - 2008-01-08 01:09:15
|
On Jan 7, 2008 10:00 AM, Neophytos Demetriou <neo...@ph...> wrote: > I'm having the same problem as outlined below. > > Basically, the log fails to roll (and so does "ns_accesslog roll") > eventhough the directory and the log file look good. What messages appear in your error log when you try to roll a file? If it's to be rolled at midnight, whether it actually rolls or not you'd expect to see a message from the sched thread. If you don't see it, then log rolling is not enabled. If you see that but the log does not actually roll, I would expect an error message of some sort. Looking through the code for this last time all error paths appear to be covered by log messages. Re permissions, look at the permissions of both the log files and the directory they're in. The server needs to have permission to create a new file under it's run-time uid/gid -- whereas at startup it creates the file as root. Also, has log file rolling never worked for you? If this is something new, what's changed recently? > Please note that "ns_rollfile" renames the existing log (say, > access.log.000) but it does not create a new one (not sure if that is > the expected behaviour). That's expected. It is a low-level routine to handle the renaming. ns_log roll and ns_accesslog roll call it and handle the reopening themselves. If you use it to roll some other kind of file manually, you'll have to take account of that. |
From: Neophytos D. <neo...@ph...> - 2008-01-07 10:00:48
|
I'm having the same problem as outlined below. Basically, the log fails to roll (and so does "ns_accesslog roll") eventhough the directory and the log file look good. Please note that "ns_rollfile" renames the existing log (say, access.log.000) but it does not create a new one (not sure if that is the expected behaviour). I've tried this on two different machines with the latest version from CVS (and TCL 8.5.0). Both machines are using software raid (raid1) and one of them uses lvm. Any ideas or suggestions? Best wishes, Neophytos PS. Please let me know if you need further info. Stephen Deasey wrote: > On 9/10/07, Bernd Eidenschink <eid...@we...> wrote: >>> grep -C1 'nslog:' server1.log >> Sent to your private mail. > > > Last correct shutdown and startup: > > [08/Sep/2007:19:02:47] Notice: nslog: closed > '/usr/local/nsroot/logs/access-server1.log' > > [08/Sep/2007:21:14:24] Notice: nslog: opened > '/usr/local/nsroot/logs/access-server1.log' > > > Here's the problem: > > > [09/Sep/2007:00:00:00][-sched-] Notice: nslog: closed > '/usr/local/nsroot/logs/access-server1.log' > > [09/Sep/2007:00:00:00][-sched-] Error: nslog: failed: roll > '/usr/local/nsroot/logs/access-server1.log': 'No such file or > directory' > > > So, access log rolling is enabled, and it failed this past midnight. > > Are you sure 'ls -l /usr/local/nsroot/logs' looks good? > > Search your error log near '09/Sep/2007:00:00:00' and there may be > more info, from rollfile etc. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel |
From: Stephen D. <sd...@gm...> - 2007-12-06 18:11:49
|
On Dec 6, 2007 5:07 PM, Vasiljevic Zoran <zv...@ar...> wrote: > > On Dec 6, 2007, at 6:05 PM, Vlad Seryakov wrote: > > > I guess this is Stephen's call > > OK, Stephen, what should we do with this? > At the moment I removed all those from my > solaris-2.8 sandbox but this is not a real > solution. So what is the purpose of %j and > why do we need it? %jd is intmax_t, you can replace them with %lld and long long. |
From: Vasiljevic Z. <zv...@ar...> - 2007-12-06 17:07:52
|
On Dec 6, 2007, at 6:05 PM, Vlad Seryakov wrote: > I guess this is Stephen's call OK, Stephen, what should we do with this? At the moment I removed all those from my solaris-2.8 sandbox but this is not a real solution. So what is the purpose of %j and why do we need it? |
From: Vlad S. <vl...@cr...> - 2007-12-06 17:04:55
|
I guess this is Stephen's call Vasiljevic Zoran wrote: > On Dec 6, 2007, at 5:41 PM, Vlad Seryakov wrote: > >> Having universal >> sprintf function like it was before takes one problem away and adding >> new specifier is not that hard thqn trying to figure out portability >> issues and chasing them for hours. > > I buy that, but this is pretty difficult to maintain, right? > I still do not know what this %j is good for... Perhaps drop > that altogether? > > > > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel > |
From: Vasiljevic Z. <zv...@ar...> - 2007-12-06 16:50:25
|
On Dec 6, 2007, at 5:41 PM, Vlad Seryakov wrote: > Having universal > sprintf function like it was before takes one problem away and adding > new specifier is not that hard thqn trying to figure out portability > issues and chasing them for hours. I buy that, but this is pretty difficult to maintain, right? I still do not know what this %j is good for... Perhaps drop that altogether? |
From: Vlad S. <vl...@cr...> - 2007-12-06 16:41:19
|
It matters because for example Windows just crashes if you specify invalid specifier, for example Linux supports %T but Windows does not, and if you specify in your c code or Tcl code %T, it will crash. Same with %j, Windows ignores it and corrupts stack, so i had to write wrapper around snprintf and replace %j which is ugly. Having universal sprintf function like it was before takes one problem away and adding new specifier is not that hard thqn trying to figure out portability issues and chasing them for hours. Vasiljevic Zoran wrote: > On Dec 6, 2007, at 5:22 PM, Vlad Seryakov wrote: > >> It is also not supported on Windows as well, i had to hack and replace >> %j with %lld on the fly. >> I guess this is modern-Linux only vsnprintf additions. >> >> Is it worth switching back to internal DStringPrintf? It was working >> fine? > > So far: > > Solaris 2.8 - bad > Solaris 2.10 - OK > Linux - OK > Mac OSX 10.3+ - OK > > It seems that this is a later addition to Unix which I was > not aware of. If Windows does not have that either we must > somehow automate that over the config scripts... > > I believe replacing with DStringPrintf will not bring anything > as this is just the format specifier, so it does not matter > if you use snprintf or vsnprintf or whatever. > > > > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel > |
From: Vasiljevic Z. <zv...@ar...> - 2007-12-06 16:29:41
|
On Dec 6, 2007, at 5:22 PM, Vlad Seryakov wrote: > It is also not supported on Windows as well, i had to hack and replace > %j with %lld on the fly. > I guess this is modern-Linux only vsnprintf additions. > > Is it worth switching back to internal DStringPrintf? It was working > fine? So far: Solaris 2.8 - bad Solaris 2.10 - OK Linux - OK Mac OSX 10.3+ - OK It seems that this is a later addition to Unix which I was not aware of. If Windows does not have that either we must somehow automate that over the config scripts... I believe replacing with DStringPrintf will not bring anything as this is just the format specifier, so it does not matter if you use snprintf or vsnprintf or whatever. |
From: Vlad S. <vl...@cr...> - 2007-12-06 16:22:47
|
It is also not supported on Windows as well, i had to hack and replace %j with %lld on the fly. I guess this is modern-Linux only vsnprintf additions. Is it worth switching back to internal DStringPrintf? It was working fine? Vasiljevic Zoran wrote: > Hi > > I'm running on a Solaris 2.8 and %jd is not known there: > > len = snprintf(buf, sizeof(buf), "%jd:%ld", > > There are handful of files which contain those. Question > is: what is %j doing? Why do we need it? > > > > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel > |
From: Vasiljevic Z. <zv...@ar...> - 2007-12-06 13:38:50
|
Hi I'm running on a Solaris 2.8 and %jd is not known there: len = snprintf(buf, sizeof(buf), "%jd:%ld", There are handful of files which contain those. Question is: what is %j doing? Why do we need it? |
From: Vasiljevic Z. <zv...@ar...> - 2007-12-04 16:55:29
|
On Dec 4, 2007, at 4:44 PM, Vasiljevic Zoran wrote: > Is there some hidden/important reason why is this so? I think I'm beginning to understand. Not that I like it but I have no other suggestion, hence I must take it as-is. |
From: Vasiljevic Z. <zv...@ar...> - 2007-12-04 16:32:54
|
On Dec 4, 2007, at 5:23 PM, Vlad Seryakov wrote: > nsd.tcl is still the only place for config, it is just instead of > hardcoding registration of callbacks for ADP in c, now they are > registered in Tcl. That means, without config.tcl .adp files will > not be > served even if enabled in nsd.tcl. Bingo. Exactly this happened here. > > > I am not sure if this is good moving core functionality into Tcl, that > means running just nsd binary now will not work properly without > proper > tcl/*.tcl files Hm... I believe there pros/cons for both. At the moment I see only cons but this might change after thinking awhile. The problem now is that config for the ADP module is dependent on two places. The config file (ns_section/ns_param) and some other magic (config.tcl) that runs ns_register_adp. If we'd follow the "module" logic and encapulate all that module needs to do in the module directory (of course we need to declare a ADP module!) then it would be logical. You would have a "module loader" that is Tcl and module can have whatever it likes (only Tcl, C or a mixture of files). But as is now, it is very confusing. At the moment I'm in a great stress to roll-out our V3 beta release so I cannot think much about that (packaging). I just need to make it work again. But I will think about that soon. |
From: Vlad S. <vl...@cr...> - 2007-12-04 16:23:32
|
nsd.tcl is still the only place for config, it is just instead of hardcoding registration of callbacks for ADP in c, now they are registered in Tcl. That means, without config.tcl .adp files will not be served even if enabled in nsd.tcl. I am not sure if this is good moving core functionality into Tcl, that means running just nsd binary now will not work properly without proper tcl/*.tcl files Vasiljevic Zoran wrote: > On Dec 4, 2007, at 4:18 PM, Vlad Seryakov wrote: > >> By not working what exactly happens? > > Just html gets served. The adp constructs are ignored. > But I believe I found the culprit... > > The file ns/tcl/config.tcl is completely new for me! > There I see: > > # > # Register ADP page handlers for GET, HEAD and POST > # requests, if enabled. > # > > proc _ns_config_server_adp_pages {server} { > > This means that ADP module needs to be setup > IN ADDITION to the server configuration file. > This is pretty obscure I would say... I will not > argue now if this is right or wrong, as I need > to make this work pronto. But having two places > where something is configured is prett confusing. > Is there some hidden/important reason why is this so? > > > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel > |
From: Vasiljevic Z. <zv...@ar...> - 2007-12-04 15:44:38
|
On Dec 4, 2007, at 4:18 PM, Vlad Seryakov wrote: > By not working what exactly happens? Just html gets served. The adp constructs are ignored. But I believe I found the culprit... The file ns/tcl/config.tcl is completely new for me! There I see: # # Register ADP page handlers for GET, HEAD and POST # requests, if enabled. # proc _ns_config_server_adp_pages {server} { This means that ADP module needs to be setup IN ADDITION to the server configuration file. This is pretty obscure I would say... I will not argue now if this is right or wrong, as I need to make this work pronto. But having two places where something is configured is prett confusing. Is there some hidden/important reason why is this so? |
From: Vlad S. <vl...@cr...> - 2007-12-04 15:18:30
|
By not working what exactly happens? I am using HEAD version with adp, no problem and no special configuration. do you have any errors in the log? Vasiljevic Zoran wrote: > Hi ! > > I just updated our code with CVS HEAD and our ADP pages > are not serving any more. No ADP processing tages place > at all. Just HTML part is sent. > What setup controls if ADP is turned on or off per server? > > I have something like: > > ns_section ns/server/$server/adp > ns_param map /*.adp > > in the config file. Obviously this is not > enough any more. > > One may wonder how come we noticed that so late? > Simple: we really only use ADP in some corner > cases. I happen to stumble accross one of those now. > > Thanks, > Zoran > > > > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel > |
From: Vasiljevic Z. <zv...@ar...> - 2007-12-04 14:36:54
|
Hi ! I just updated our code with CVS HEAD and our ADP pages are not serving any more. No ADP processing tages place at all. Just HTML part is sent. What setup controls if ADP is turned on or off per server? I have something like: ns_section ns/server/$server/adp ns_param map /*.adp in the config file. Obviously this is not enough any more. One may wonder how come we noticed that so late? Simple: we really only use ADP in some corner cases. I happen to stumble accross one of those now. Thanks, Zoran |
From: Stephen D. <sd...@gm...> - 2007-11-29 08:47:07
|
On Nov 29, 2007 7:40 AM, Vasiljevic Zoran <zv...@ar...> wrote: > > On Nov 29, 2007, at 8:10 AM, Stephen Deasey wrote: > > > It was returning a boolean value, guaranteed. It used Tcl_GetBoolean > > to parse the value from the config file, and Tcl_GetBooleanFromObj to > > check the default value. If both of those calls return TCL_OK, then > > whatever comes out the other side is a valid boolean value. > > What about: > > puts "[expr {0 == 0}]" > > What is this going to return in your tclsh? > Is it going to say > > true > or > t > or > yes > > ? > > NO. It is printing: > 1 > > It will NEVER print anything else. Hence you cannot > test string equality for expressions with "false"/"no" etc > but you CAN test it with numerical value of 0 (zero) > or non-zero. > > Allright? Not alright. There is no dispute about what the string rep of a boolean expression is: it's 0 or 1. But it's irrelevant. We're concerned with input, not output. Specifically: what does the 'if' command require as it's first argument? The answer is: boolean. Not int. Not string. Which is why you can test like this: On Nov 29, 2007 7:33 AM, Vasiljevic Zoran <zv...@ar...> wrote: > > > > This is a false dilemma. > > > > A string equality expression is not the only substitute for an integer > > comparison expression. > > > > if {$boolilicious} { ;# <--- boolean expression > > puts "truthy" > > } > > > > In the IDEAL world, we would have Tcl types. But then again, > why bother with Tcl and don't use Java or C## or something > "typed"? I'm not sure which ideal world you're wishing for, but here In the real world, try this: % set bool 1 % if {$bool} {puts "this totally worked!"} % set bool true % if {$bool} {puts "this sooo worked!"} I've explained how it works, but it really doesn't matter. All that matters is that it does, in fact work. |
From: Vasiljevic Z. <zv...@ar...> - 2007-11-29 07:40:46
|
On Nov 29, 2007, at 8:10 AM, Stephen Deasey wrote: > It was returning a boolean value, guaranteed. It used Tcl_GetBoolean > to parse the value from the config file, and Tcl_GetBooleanFromObj to > check the default value. If both of those calls return TCL_OK, then > whatever comes out the other side is a valid boolean value. What about: puts "[expr {0 == 0}]" What is this going to return in your tclsh? Is it going to say true or t or yes ? NO. It is printing: 1 It will NEVER print anything else. Hence you cannot test string equality for expressions with "false"/"no" etc but you CAN test it with numerical value of 0 (zero) or non-zero. Allright? |
From: Vasiljevic Z. <zv...@ar...> - 2007-11-29 07:33:33
|
On Nov 29, 2007, at 8:10 AM, Stephen Deasey wrote: > On Nov 29, 2007 6:45 AM, Vasiljevic Zoran <zv...@ar...> wrote: >> >> On Nov 29, 2007, at 7:32 AM, Stephen Deasey wrote: >> >>> >>> Are you saying that "false" is not false and "true" is not true? >> >> I'm saying that false IS zero and 1 IS true (better, non-zero is >> true). > > > OK. But why are you saying that? Because you asked: "Are you saying that "false" is not false and "true" is not true?" so I wanted to make clear what I'm saying. > > > The Tcl man pages define explicitly what the valid values for boolean > are, and in what context booleans are expected. Can you point to the > part which supports your argument? > I cannot, because Tcl has no strict typing. All this is really best-effort where possible. This is not something that the language enforces. You can't (nobody can) make Tcl typed language as if you want to do that, you will break the backward compat and in this particular case, you would defeat the whole purpose of the language. > >> But this can bring us to the question: >> >> set value [ns_config -bool jummy juice false] >> if {$value == "true"} { >> # ... >> } >> >> and all sorts of other weird things. I know I know... > > > This is a false dilemma. > > A string equality expression is not the only substitute for an integer > comparison expression. > > if {$boolilicious} { ;# <--- boolean expression > puts "truthy" > } > In the IDEAL world, we would have Tcl types. But then again, why bother with Tcl and don't use Java or C## or something "typed"? > >> This all ISN'T very clear because Tcl's C-heritage and >> LACK of proper boolean type (actually lack of ANY types). > > > Tcl has a boolean type: > > http://www.tcl.tk/man/tcl8.5/TclLib/BoolObj.htm > > It's string rep when false is 0, false, no, f and so on. > This is only a boolean type if you want to treat it as boolean. Otherwise it is just a string. > >> So, we cannot teach Tcl types, we can only make some >> approximations. The (ns_config )code was simply too strict >> at that place > > > It was returning a boolean value, guaranteed. It did, yes. But it did not follow the assumption that people would test the return value with numeric comparison relying on the fact that zero IS true. And this is what you are accustomed when comming for C. Nobody in C would write char *false = "false" if (false) { } and everybody is simply accustomed to zero/nonzero integer value to hold for false/true. This is also valid for Tcl. Just about lately they (Tcl) started to mingle with true/false in expressions and that created all this mess. We cannot fix that mess. But I'm also not going to change my scripts because of that mess. But hold on... why are we consuming list bandwidth on this obvious thing? It is simple as that: the code was not broken essentialy. It was simply too "straight" and broke backward compatibility w/o any good reason. |
From: Stephen D. <sd...@gm...> - 2007-11-29 07:10:51
|
On Nov 29, 2007 6:45 AM, Vasiljevic Zoran <zv...@ar...> wrote: > > On Nov 29, 2007, at 7:32 AM, Stephen Deasey wrote: > > > > > Are you saying that "false" is not false and "true" is not true? > > I'm saying that false IS zero and 1 IS true (better, non-zero is true). OK. But why are you saying that? The Tcl man pages define explicitly what the valid values for boolean are, and in what context booleans are expected. Can you point to the part which supports your argument? > But this can bring us to the question: > > set value [ns_config -bool jummy juice false] > if {$value == "true"} { > # ... > } > > and all sorts of other weird things. I know I know... This is a false dilemma. A string equality expression is not the only substitute for an integer comparison expression. if {$boolilicious} { ;# <--- boolean expression puts "truthy" } > This all ISN'T very clear because Tcl's C-heritage and > LACK of proper boolean type (actually lack of ANY types). Tcl has a boolean type: http://www.tcl.tk/man/tcl8.5/TclLib/BoolObj.htm It's string rep when false is 0, false, no, f and so on. > So, we cannot teach Tcl types, we can only make some > approximations. The (ns_config )code was simply too strict > at that place It was returning a boolean value, guaranteed. It used Tcl_GetBoolean to parse the value from the config file, and Tcl_GetBooleanFromObj to check the default value. If both of those calls return TCL_OK, then whatever comes out the other side is a valid boolean value. |
From: Vasiljevic Z. <zv...@ar...> - 2007-11-29 07:08:44
|
On Nov 29, 2007, at 7:45 AM, Vasiljevic Zoran wrote: > The change isn't going to break anybody's scripts and is > "in the spirit" of the (Tcl) language. *Strictly* speaking it would break, if you were testing string equality on "true" and "false" but then again, the older scripts would never have worked, as ns_config DID normalize return values to 0/1 some times before. |
From: Vasiljevic Z. <zv...@ar...> - 2007-11-29 06:46:01
|
On Nov 29, 2007, at 7:32 AM, Stephen Deasey wrote: > > Are you saying that "false" is not false and "true" is not true? I'm saying that false IS zero and 1 IS true (better, non-zero is true). If false IS zero then testing the value for zero EQUALS testing the value for false. Or not? This was NOT so in the implementation, hence I had to correct that. But this can bring us to the question: set value [ns_config -bool jummy juice false] if {$value == "true"} { # ... } and all sorts of other weird things. I know I know... This all ISN'T very clear because Tcl's C-heritage and LACK of proper boolean type (actually lack of ANY types). So, we cannot teach Tcl types, we can only make some approximations. The (ns_config )code was simply too strict at that place, which broke our scripts at various places. The change isn't going to break anybody's scripts and is "in the spirit" of the (Tcl) language. |