Re: Adding a custom symbol

"Valeriy E. Ushakov" <[email protected]>
Newsgroups gmane.comp.type-setting.lout
Message-ID <[email protected]>
On Mon, Jan 16, 2012 at 09:33:02 +0000, Mark Summerfield wrote:

> On Fri, 13 Jan 2012 21:55:12 +0400
> "Valeriy E. Ushakov" <[email protected]> wrote:
> [snip]
> > Ok, got around to actually test it:
> > 
> > @SysInclude { doc }
> > 
> > export @Monochrome
> > def @MyOptions
> >   named @Monochrome { No }
> > {}
> > 
> > @Use { @MyOptions }
> > 
> > @Doc @Text @Begin
> > @LP Monochrome is @Monochrome
> > @End @Text
> > 
> > 
> > $ lout -p -s override.lt | uniq
> > 
> >           Monochrome is No
> > 
> > $ lout -p -s --'@Monochrome{Yes}' override.lt | uniq
> > 
> >           Monochrome is Yes
> 
> I did this and put lines like this in my document:
> 
>     @CD @Monochrome @Case {
>     Yes @Yield @IncludeGraphic{"images/quadratic2-linux-bw.eps.gz"}
>     else @Yield @IncludeGraphic{"images/quadratic2-linux.eps.gz"}
>     }
> 
> This gave no error messages but didn't work reliably.
> 
> So I changed them to this:
> 
>     @CD @Monochrome @Case {
>     Yes @Yield @IncludeGraphic{"images/quadratic2-linux-bw.eps.gz"}
>     No @Yield @IncludeGraphic{"images/quadratic2-linux.eps.gz"}
>     }
> 
> This seems to work reliably but outputs some strange error messages (but
> only in the --'@Monochrome{Yes}' case:
> 
>     replacing unknown @Case option ?? by Yes
> 
> Anyway, it works, so that you very much:-)

Only by chance.  Try it with --'@Monochrome{No}' :)


Now, this is weird.  Consider this:

---8<------8<------8<------8<---
@SysInclude { doc }

export @Monochrome
def @MyOptions
  named @Monochrome { No }
{}

@Use { @MyOptions }

#def @WHATEVER { @Monochrome }

@Doc @Text @Begin
@LP Monochrome is @Monochrome

@LP @Monochrome @Case {
Yes @Yield { Black and White }
No  @Yield { Colorful }
}

@End @Text
---8<------8<------8<------8<---


It generates "replacing unknown @Case option ?? by Yes".  But if you
uncomment definition of @WHATEVER (unused!), it puts the lout on the
right track.

I thoroughly forgot most of the internals, so I guess Jeff will have
to comment on this.

-uwe
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.