Python Binding [Was: Re: PYTHON VS. PERL VS. TCL ]

jredford@lehman.com
Thu, 20 Apr 95 10:10:26 -0400

> From: aaron@funcity.njit.edu (Aaron Watters)
> Subject: Re: PYTHON VS. PERL VS. TCL
>
>
> In article <9504181433.AA17470@seelebrennt.lehman.com> jredford@lehman.com writ
> es:
> >> I do not usually reply to obvious flame bait such as this....
>
> Well I do. I do it because it's kinda fun. I also think its good to
> correct what I see as mistakes before they become "conventional

I need to correct this. I didnt not write that first line. You missed
an attribution to Steve M.

I will gladly reply to flame bait with flames.

> If you want to write your own language within a language, try Common
> Lisp's macro facility. Here a programmer can build his/her own idioms
> and constructs which no other programmer in the world will ever
> understand, possibly including 'self' 6 months later (believe me, I
> know). It's lots of fun, but probably not a good idea. You'd be

Its has its uses. Again, I am not judging that you should or shouldnt
do it, but when you do, use the right tool. I would, as I said, use
[the] Scheme [macro facility].

> I liked your suggestion that Python should have earlier bindings,
> so that an undefined os-specific function is detected at load time
> and not in the middle of a computation. At present this would suggest
> that one should use
>
> import neat_function from os_specific_module
>
> (to get an error on load) in place of
>
> import * from os_specific_module
>
> or
>
> import os_specific_module
> ...
> os_specific_module.neat_function(...)

Indeed, but this is just the cleanest possible workaround at present.
I dont think that one should trash the idea of modules and bind
everything to the localname space just to get around a langauge
deficiency.

> and that implementations should never use errors such as
>
> # os_specific_module for itty-bitty-machines
> def neat_function(...):
> raise SystemError, "not implemented on this itty-bitty-machine"

Definitely. Writing functions that do something other than what they
are supposed to should always be a clear violation of convention.

> In the long term, I think it might be nice if Python could do more early
> module/function bindings at load time. This would prevent some abuses
> (which, unfortunately, can sometimes be useful) and have the added
> benefit of making Python run faster. -a.

...Certainly some static checking would do a world of good. Python
could always appropriate another page from Modula-3 and introduce
unsafe modules where abuse can run rampant, because it IS sometimes
useful.

--
John Redford (AKA GArrow) | 3,600 hours of tape.
jredford@lehman.com       | 5 cans of Scotchguard.