[Edinburgh-pm] Someone is wrong on the Internet, and I'm worried it's me

Miles Gould miles at assyrian.org.uk
Sun Aug 1 08:58:04 PDT 2010


On Sun, Aug 01, 2010 at 04:21:40PM +0100, Julian Turnbull wrote:
> Which misbegotten language(s) would this be?

The language that aroused my ire was Frink (http://futureboy.us/frinkdocs/),
which is rather like units(1) on speed. His intended niche is short,
engineering-type calculations, particularly on portable devices, but
still, there's no excuse for doing something so obviously wrong.

> I remember working with that kind of code-reuse - with punched cards,
> somewhere around 1975.

PHP did this for a long time, too - anyone know if they've seen the
error of their ways yet? I know PHP only got namespaces surprisingly
recently.

> I'd be interested to hear what other mongers make of the Perl-Python
> comparison in this regard.  I'm just dipping a toe in the water with
> Python, so I don't know enough to make a sensible contribution.

I haven't used Python for a while, but here's what I remember about the
module system:

1) The actual module-loading business is much like Perl's: when you ask
to import foo.bar.baz.spoffle, a configurable list of directories is
searched for the file foo/bar/baz/spoffle.py, and the first one to be
found is compiled and loaded, with the functions by default living in
the foo.bar.baz.spoffle namespace.
2) You can also do "from X import *" or "from X import f, g, h", which
imports all public objects from X (or just the specified ones) into your
namespace.

Unlike in Perl, AIUI, (2) is a language feature and not overridable by
user code.

Miles

-- 
For a successful technology, reality must take precedence over public
relations, for nature cannot be fooled.
  -- Richard Feynman


More information about the Edinburgh-pm mailing list