A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2002-March/021420.html below:

[Python-Dev] A Hygienic Macro System in Python?

[Python-Dev] A Hygienic Macro System in Python? [Python-Dev] A Hygienic Macro System in Python?David Ascher DavidA@ActiveState.com
Mon, 18 Mar 2002 17:35:08 -0800
Daniel Mahler:

> Consider a html printer macro library:
> 
> html:
>     header:
>         title:
>             print "blah"
>     body:
>         h1:
>             print "bleh"
>         p:
>             print "foo"
>             a (href="http://bar.org"):
>                 print "bar"
>             print "baz"
> 

funny.  That's not too far from code that I write in Quixote w/ some
extra functions:


template page(request):
	header(title("blah"))
	body(hl("bleh"),
             p(("foo", 
                a(href="...","bar")),
             "baz"
             )

note that template is the Quixote part, which removes the need for
unsightly prints =)

My vote on the notion is that I want to know what good macros people
would write, and then implement them in a non-macro fashion.  The lock
or connection examples to me indicate a possible language addition which
boils down to something nice and essential (in the meaning of 'of the
essence').  Macros in their generality scare me.

--david



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4