This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: some Python Zen (Re: Python transformer for Guile?)
> When you say ``foo[bar]'', what python really does is
> ``foo.__getitem__(bar)''. (At least in theory; there are
> probably some optimizations involved with base types.) This
> maps a lot more nicely to Scheme.
>
> Ditto for ``foo.bar''; you can express it as
> ``getattr(foo, 'bar')''.
It should perhaps be noted here that __getattr__() is only called on an
object
if the argument (in this case 'bar') is not in the object's dictionary.
> And that's pretty much all there is to it.
I found the language reference that comes with Python to be quite
thorough.
Actually, the main reason why I'm writing is to ask what the status of
the
Python translator is. I'm quite familiar with Python internals (I'm
currently
working on a patch to extend thread support to incorporate Guile's
notion
of 'engines', because I like the idea muchly), and was considering
offering my aid.
I'd started writing a scheme program to run python bytecode files, which
is not
quite as useful, I realize, but it was an interesting excersize and
seemed a good
way to learn Scheme. (I got as far as porting the Python marshalling
facility
and coming up with vague ways to emulate/represent the various Python
base types)
Interrupt: Question: Is there some easy way in Guile to read in
C/machine formatted
numbers (longs, shorts, etc.) from a file? I ended up doing
it myself,
plucking out all the bits and doing 2's compliment and such,
highly
annoying. (return)
before starting to think about the ways to *trasnslate* the language
rather than
merely implement a Python interpreter with some language interface.
I'd of course be excited to offer whatever aid I can to the translator
project,
although I'm admittedly as green to guile as I am pink to python. Is
there a web
page for the project? Who are you all? Is anybody receiving me? =)
Cheers,
dj trombley
<dtrom@building.clark.net>