atom feed12 messages in org.apache.tcl.rivet-devRe: How about "var get varname ?defau...
FromSent OnAttachments
David N. WeltonOct 17, 2002 7:09 pm 
Zeinert, HolgerOct 18, 2002 12:08 am 
David BrancatoOct 18, 2002 6:39 am 
David N. WeltonOct 18, 2002 10:08 am 
David N. WeltonOct 18, 2002 11:28 am 
David BrancatoOct 19, 2002 1:34 am 
David N. WeltonOct 19, 2002 3:58 pm 
Damon CourtneyOct 19, 2002 5:25 pm 
David N. WeltonOct 19, 2002 5:30 pm 
David N. WeltonNov 4, 2002 5:38 pm 
David BrancatoNov 4, 2002 9:30 pm 
David N. WeltonNov 5, 2002 10:15 am 
Subject:Re: How about "var get varname ?default?" ?
From:David Brancato (Dav@Brancato.com)
Date:Oct 19, 2002 1:34:23 am
List:org.apache.tcl.rivet-dev

----- Original Message ----- From: David N. Welton <dav@dedasys.com>

Hrm, does it make sense to throw an error instead of returning ""? For some reason, I thought it did:-) I actually think that that is more correct, because "" really means foo=&bar=baz - an empty value. Any objections? If people want the default empty value, they can put it in:-)

Personally, I'm against erroring on this. I think the convenience of having it return "" is well worth it. Otherwise, scripters the world over will end up typing [var get foo ""] for everything that doesn't have a default value just so they don't have to worry about triggering an error. In this sense, the default value is no longer optional. Plus, most major scripting environments don't error on this (CGI.pm, PHP, ASP). I know that alone is no reason but I think in this case they all weighed convenience vs. more correct. Rivet atleast has [var exists foo] if the scripter needs that level of control.

- David Brancato