Re: Explanation of macros; Haskell macros

Discussion in 'Python' started by Michael T. Babcock, Nov 3, 2003.

  1. >
    >
    >The costs: syntax seems to be constrained to have a very regular surface
    >structure full of parentheses; the language must describe and implement a
    >representation of code as data which would otherwise be unnecessary; every
    >compiler must include an interpreter; it's hard to report errors to the
    >user showing the code as it's written in the source if the error is found
    >after macro expansion.
    >


    I don't really want to jump into the middle of a discussion here, but if
    someone wanted to do this in Python, one *can* of course write Python
    code that generates Python code and then executes it. This gives the
    compile-time type macro execution timeframe; build the code you want to
    execute with Python before executing it then execute it. There's no
    need for an additional macro-like system when your runtime allows you to
    execute your own strings.

    I know this is a higher-order discussion on the merits of macro systems
    in other languages and how they'd benefit (or not) Python, but I decided
    to throw my $0.02 (CAN) in.

    --
    Michael T. Babcock
    C.T.O., FibreSpeed Ltd.
    http://www.fibrespeed.net/~mbabcock
     
    Michael T. Babcock, Nov 3, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    80
    Views:
    2,517
    Stephen J. Bevan
    Nov 7, 2003
  2. Replies:
    1
    Views:
    492
    Marco Antoniotti
    Oct 7, 2003
  3. Replies:
    5
    Views:
    514
  4. Casey Hawthorne
    Replies:
    3
    Views:
    351
  5. Alia Khouri
    Replies:
    0
    Views:
    256
    Alia Khouri
    Oct 31, 2010
Loading...

Share This Page