This is the mail archive of the
xconq7@sources.redhat.com
mailing list for the Xconq project.
Re: Swedis Place Name Generator
Stan Shebs wrote:
>
> Stan Shebs wrote:
> >
> > Erik Sigra wrote:
> > >
> > > (reject "Åå"
> > > "åå"
> > > "älvälv" ;Quotation needed to avoid segfault
> >
> > Tsk tsk, another bug... :-)
>
> Easy fix, the hash function for names was returning negative
> numbers because of 8-bit chars - the first time they're being
> used I guess.
>
> > > ) ;This doesn't work! (How do I use reject?)
>
> After a little study of the code, I decided to go with the
> "reject is a special rule body" approach, since it's more
> general and no harder to implement. So basically you use
> it by wrapping around another rule body, as in
>
> (nonterm (reject (or term (term " " term)) abc "de f" ghi))
>
> where names built from term or a sequence of two terms
> cannot have any of "abc", "de f", or "ghi" appearing in them.
Thanks! I'll work a little more on the swedish place name generator now
and post it soon.
Have you thought about a rule called "replace", that works similar to
reject, but instead of rejecting, it replaces? For example:
(mainpart (replace preliminary-mainpart (hh h) (rrr rr)))
This would fix "Southhall" and "Norrryd".