To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.off-topic.geekOpen lugnet.off-topic.geek in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Off-Topic / Geek / 1510
1509  |  1511
Subject: 
Re: TMTOWTDI (was: Re: NQC in Boston University Linux :))
Newsgroups: 
lugnet.off-topic.geek
Date: 
Sat, 8 Apr 2000 01:00:44 GMT
Reply-To: 
MATTDM@MATTDMantispam.ORG
Highlighted: 
(details)
Viewed: 
229 times
  
Todd Lehman <lehman@javanet.com> wrote:
  ref $foo or die "blah";   # assertion that $foo should be a reference
  !ref $foo and die "blah";   # assertion that $foo should not be a scalar
  if (!ref $foo) { die "blah"; }   # dies for some $foo; emphasis on test
  unless (ref $foo) { die "blah"; }   # dies for most $foo; emphasis on test
  die "blah" if !ref $foo;   # dies for some $foo; emphasis on die
  die "blah" unless ref $foo;   # dies for most $foo; emphasis on die

Well, in python, that's very easy, since all variables are references.
But, for example, to test if 'foo' is a callable object (a function, class,
method, etc...), this is the Way:

     if not callable(foo):
        sys.exit(1)


As I understand it, any other syntax is Wrong. (Well, actually, it's
probably more correct to handle the error more gracefully. But that's a
separate issue.)


I feel crippled in a langage which forces me to write all of the above a
single way -- and not just for quick-hack code.

This may be a good clue that python is not for you. :)

--
Matthew Miller                      --->                  mattdm@mattdm.org
Quotes 'R' Us                       --->             http://quotes-r-us.org/



Message is in Reply To:
  TMTOWTDI (was: Re: NQC in Boston University Linux :))
 
(...) I'd like to take a close look at Python someday, but I doubt I'll end up using it if it's got the frustrations of other syntactically challenged languages. (My favorite programming languages are Perl, PostScript, and LISP/Scheme/Logo for their (...) (24 years ago, 7-Apr-00, to lugnet.off-topic.geek)

18 Messages in This Thread:





Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR