Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Python Macros

Reply
Thread Tools

Re: Python Macros

 
 
Josiah Carlson
Guest
Posts: n/a
 
      10-04-2004

> How hard/easy is it to extend the Python syntax? Perhaps there are


Check out the tokenizer module.


> macro facilities for this?


Python has no macro facilities.


> I'd like to add messages and message
> passing, for example.


Macros are not necessary for message passing. There are at least a
dozen message passing libraries for inter and intra-machine
communications, including versions that work with DCOM, Corba, MPI, and
I'm sure just about anything else you could want to do.

Heck, writing message passing with TCP sockets is even quite easy, if
you have experience with writing network protocols.

If you are just wanting to pass messages in your program, and you are
using threads, use the Queue module (in 2.4 it will be faster).

- Josiah

 
Reply With Quote
 
 
 
 
Lonnie Princehouse
Guest
Posts: n/a
 
      10-05-2004
Josiah Carlson <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> > How hard/easy is it to extend the Python syntax? Perhaps there are

>
> Check out the tokenizer module.


Sort of OT for this thread, but I've found that tokenize isn't well
suited to extending syntax, unless you actually want to copy and edit
the module's source.

The module has a bunch of code to generate its regular expressions
that executes in its global scope at import time, so you'd have to
duplicate that code in order to modify these expressions.

One might expect something a little more object-oriented out of Python
(e.g. a Tokenizer class that can be inherited and behavior of the
subclass modified), but that's not how it's currently set up.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
macros-loop? calling macros X times? Andrew Arro C Programming 2 07-24-2004 09:52 AM
Explanation of macros; Haskell macros mike420@ziplip.com Python 80 11-07-2003 02:22 AM
Re: Explanation of macros; Haskell macros Michael T. Babcock Python 0 11-03-2003 01:54 PM
Re: Explanation of macros; Haskell macros mike420@ziplip.com Python 5 11-01-2003 01:09 AM
Re: Explanation of macros; Haskell macros mike420@ziplip.com Python 1 10-07-2003 04:07 PM



Advertisments