>> Which language(s) do you know that has such a feature?
>
> I should came from Marco Cantu's Delphi 2005 book, that I have read just
> recently.
> But I am unable to find it again.
I'd be very surprised if it came from Delphi for two reasons:
a) I used Delphi a lot for several years and never c
Dear Tim,
Dear Alan,
>> I can't find the defined() function in python, so I used
>>'variable name' in dir()
>
>> Is it really missing, or I am just so simple ?
>
> It is really missing, just as it is for most programming languages.
> Which language(s) do you know that has such a feature?
I shou
* Danny Yoo <[EMAIL PROTECTED]> [060403 18:14]:
>
> > > I'm interested in what use you would make of such a thing?
> > My business partner is a perl programmer. He uses defined() a lot, I
> > think, I've seen it in his code
>
> Now, if your business partner doesn't have the line 'use stri
* Bob Gailer <[EMAIL PROTECTED]> [060403 17:12]:
>
> def defined(name):
> return name in globals()
>
Hah! Good tip. I'll call it value()
I think "language wars" are a waste of time, but
I like the way that using different languages
inform the programmer.
cheers
tj
--
Tim Johnson <[
> > I'm interested in what use you would make of such a thing?
> My business partner is a perl programmer. He uses defined() a lot, I
> think, I've seen it in his code
Hello!
The common idiom in Perl, I think, is to at least declare the variable,
even if one doesn't give an initial value
* Alan Gauld <[EMAIL PROTECTED]> [060403 09:10]:
>
> > I can't find the defined() function in python, so I used
> >'variable name' in dir()
>
> > Is it really missing, or I am just so simple ?
>
> It is really missing, just as it is for most programming languages.
> Which language(s) do you know
Hugo González Monteverde wrote:
> Alan Gauld wrote:
>
>
>> Which language(s) do you know that has such a feature?
>> And why do you consider it so useful that you expect to find
>> it in Python?
>>
>
> I'm not the original poster, but being a perlhead before, I can say it
> exists in Perl.
Alan Gauld wrote:
> Which language(s) do you know that has such a feature?
> And why do you consider it so useful that you expect to find
> it in Python?
I'm not the original poster, but being a perlhead before, I can say it
exists in Perl. It is very often used too.
I used to miss it at first,
> I can't find the defined() function in python, so I used
>'variable name' in dir()
> Is it really missing, or I am just so simple ?
It is really missing, just as it is for most programming languages.
Which language(s) do you know that has such a feature?
And why do you consider it so useful th
[János Juhász]
| I can't find the defined() function in python, so I used
|
| 'variable name' in dir()
|
| for check if the variable defined.
|
| >>> name = 'Joe'
| >>> if 'name' in dir():
| ... print name
| ...
I'm not entirely sure where you'd want
to use this,
Hi All,
I can't find the defined() function
in python, so I used
'variable name' in dir()
for check if the variable defined.
>>> name = 'Joe'
>>> if 'name' in dir():
... print name
...
Joe
Is it really missing, or I am just
so simple ?
Yours sincerely,
__
11 matches
Mail list logo