Skip to Content.
Sympa Menu

texmacs-users - Re: [TeXmacs] macros, passing paramaters to with, and using includes

Subject: mailing-list for TeXmacs Users

List archive

Re: [TeXmacs] macros, passing paramaters to with, and using includes


Chronological Thread 
  • From: "Corey Sweeney" <address@hidden>
  • To: address@hidden
  • Cc: address@hidden, address@hidden
  • Subject: Re: [TeXmacs] macros, passing paramaters to with, and using includes
  • Date: Thu, 9 Mar 2006 17:07:28 -0600
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=efvuvW0irhqgKrfnytXh1f4mSIGWO+MO4AnawSgZrfFZRXgOGFCeO5cvq0af9DUJVKLXX/B+VC6oX2pOZfp9vcV2u7eC9cs2pXr6rR0HZO/5pwe4/GyfQoHddKxm3QqfelK5PXWEqm5qF6tm4NxtFNmTDod64zfwnLeRGZthMwk=



On 3/8/06, Henri Lesourd <address@hidden> wrote:
Corey Sweeney wrote:

 

But this one *still* doesn't work, due to f!@#$%g problems of
symbol encoding (for the symbol ">" in "tree->string"...), because
we want to write the Scheme code directly inside the TeXmacs <extern>
markup (the clean alternative solution would be to write a Scheme
plugin where we could safely write our Scheme functions. But then
we would have to deal with the current bug in the recently implemented
lazy evaluation of Scheme plugins ; I'm afraid that discussing this
would lead us even farther in designing hacks...).

Thus we need to trick it ; the following way works :
[[
   <macro|inc0|<macro|x|<extern|(lambda (x) (tree-load-inclusion
     ((eval-string (string-append "tree-" (substring ">" 4 5) "stree"))
     x)))|<arg|x>>>
]]


Great idea.  I had been adding "(define tree-to-stree tree->stree)" to my startup scheme libaries.  Now I decided to one up you and abstract it:

(define horrible-scheme-hack-fun
  (lambda (some-symbol)
    (string->symbol
       (list->string
         (map (lambda (char)
                    (if (equal? char #\} )
                       #\>
                       char))
                 (string->list (symbol->string some-symbol)))))))

Of course, you'll probalby just one up me back and make it a macro :)

Wanna toss something like this in the texmacs scheme libraries?  then we could change yoru code to:


[[
   <macro|inc0|<macro|x|<extern|
       (lambda (x) (tree-load-inclusion  ((horrible-scheme-hack `tree-}stree) x)))|<arg|x>>>
 ]]

which would seem easier to read.  The charactor could be something other then }, let's just make a "hacking standard" so everyone uses the same char till another solution presents it'self.



I'll let ya know how it goes as soon as I can try out your files/macros.

Corey

--
((lambda (y) (y y)) (lambda (y) (y y)))


Archive powered by MHonArc 2.6.19.

Top of Page