lout-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Whole appendix in lines @Break?


From: Wolfram Kahl
Subject: Re: Whole appendix in lines @Break?
Date: Tue, 21 Mar 2000 14:38:13 +0100


Thomas McDermott <address@hidden> writes:
 > 
 > I'm trying to include a program written in Perl in an appendix of my
 > thesis (a "book").

 > [...]

 > So I wrote some code to protect the 11 Special Characters 
 > (/|&address@hidden")
 > with double quotes, so now I have something that looks great if I can
 > get it into @F and lines @Break...but now it isn't breaking across
 > pages!
 > 
 > What did my brain miss?

Protect it line by line: my FunnelWeb filter ``loutfw''
(implemented as a OCaml stream parser)
produces the following on a fragment of Haskell
(if you like Lout, you will probably like both OCaml/OLabl and Haskell
 better than Perl ;-)
for use inside my @Verbatim-inspired @FunnelWeb environment:


{0.8 1.0} @Scale {"> instance (Monad m, XCAT e) => Monad (EE m e) where"}
{0.8 1.0} @Scale {">   return x = EE (return (Left x, Nothing))"}
{0.8 1.0} @Scale {">   (EE f) >>= g  =  EE"}
{0.8 1.0} @Scale {">            (f   >>= \\ (xa1 , me1) ->"}
{0.8 1.0} @Scale {">             case xa1 of"}
{0.8 1.0} @Scale {">               Left a1 ->"}
{0.8 1.0} @Scale {">                 let (EE g') = g a1 in"}
{0.8 1.0} @Scale {">                 g' >>= \\ (xa2, me2) ->"}
{0.8 1.0} @Scale {">                 return (xa2, xmcat me1 me2)"}
{0.8 1.0} @Scale {">               Right e1 -> return (Right e1, me1)"}
{0.8 1.0} @Scale {">            )"}

{0.8 1.0} @Scale {"> xmcat Nothing me2 = me2"}
{0.8 1.0} @Scale {"> xmcat me1@(Just e1) Nothing = me1"}
{0.8 1.0} @Scale {"> xmcat (Just e1) (Just e2) = Just (xcat e1 e2)"}



This then lands in about the same environment that you need:


    def @FunnelWeb right x
    {
        def @Filter {
            loutfw @FwHide @FilterIn @FilterOut
        }
        {lines 0.99fx} @Break {Courier Base -2p} @Font x
    }


Hope that helps!


Best regards,

Wolfram


reply via email to

[Prev in Thread] Current Thread [Next in Thread]