Re: "no variable or argument declarations are necessary."
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: "no variable or argument declarations are necessary."

From: Paul Rubin <//phr.cx@NOSPAM.invalid>
Date: Wed Oct 05 2005 - 11:35:15 CEST

Brian Quinlan <brian@sweetapp.com> writes:
> > Python already has a "global" declaration;
>
> Which is evaluated at runtime, does not require that the actual global
> variable be pre-existing, and does not create the global variable if
> not actually assigned. I think that is pretty different than your
> proposal semantics.

Different how?

> Your making this feature "optional" contradicts the subject of this
> thread i.e. declarations being necessary.

They're necessary if you enable the option.

> But, continuing with your declaration thought experiment, how are
> you planning on actually adding optional useful type declarations to
> Python e.g. could you please rewrite this (trivial) snippet using
> your proposed syntax/semantics?

def do_add(x->str, y->str):
      return '%s://%s' % (x, y)

def do_something(node->Node):
      if node.namespace == XML_NAMESPACE:
          return do_add('http://', node.namespace)
      elif node.namespace == ...
Received on Sat Oct 15 04:09:47 2005