Home
est's Journal
 
[Most Recent Entries] [Calendar View] [Friends]

Below are the 3 most recent journal entries recorded in est's LiveJournal:

    Thursday, January 11th, 2007
    4:07 pm
    Robert Anton Wilson dies
    I mistakenly opened a spam email when I thought I was opening one
    about Robert Anton Wilson's passing. The first words I saw were:
        footsteps, in the garden that I dreamed of walking in all night
    
    I think that would have appealed to aleatoric Uncle Bob. :)
    Tuesday, November 28th, 2006
    10:37 pm
    e7's pluggable text quoters in format strings

    I just implemented this. :)

    The idea is that a format escape like %'foo's applies foo-quotation to the generated text. (%r also supports this)

    Here's a REPL session:

    >>> (format "<h1>%'html's</h1>" "<<>>")
       0 (format "<h1>%'html's</h1>" "<<>>")                 /dev/ttyp4:1
    FormatError: unknown quoter name html at 6 "<h1>%'html's</h1>"
    >>> (import strings)
    >>> (import html)
    >>> (setattr strings.format-quoters 'html html.escape)
    #<EFunction (s) (begin (set s (replace "&" "&amp;" s)) (set s (replace "<" "&lt
    ;" s)) (set s (replace ">" "&gt;" s)) (set s (replace "'" "&apos;" s)) (set s (
    replace "\"" "&quot;" s)) s)>
    >>> (format "<h1>%'html's</h1>" "<<>>")
    "<h1>&lt;&lt;&gt;&gt;</h1>"
    
    Saturday, September 3rd, 2005
    8:20 pm
    U.S. Chief Justice Rehnquist Dead
    ..and I just read this thing about him eating most of Sandra Day O'Connor's brain: http://www.theonion.com/content/node/37456 (via geoffcapp)
About LiveJournal.com

Advertisement