This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: text munging


Eric Moore <moore@chem.cmu.edu> writes:

> One more improvement might to be to modify the bottom form to be:
> 
> (stream-for-each
>  (lambda (x)
>    (let ((y (transform x)))
>      (cond
>       ((string? y) (display (transform x))
>                    (newline)))))
> 
>  input)
> 
> then we can add
> 
> (define (delete-if-blank line)
>   (if (string-null? line) #f line))
> delete-if-blank
> 
> and remove other lines as well with appropriate tests...
> 
> theoretically, with that we could wrap the calls to
> regexp-substitute/global in false-if-exception so that expressions of
> the form: 
> ("^#" #f)
> cause regexp-substitute/global to throw an error, the function to
> return false and the line to not be printed, deleting lines beginning
> with #...
> 
> That is getting really ugly though :)

good.  very good.  by the way, you misspelled "postmodern" ;)

>   -Eric

HTH, HAND, Larry Wall loves you,
--mike

P.S. on a serious note, this stuff is getting quite useful.  is the
"cookbook" section of the Guile FAQ still maintained?  or the FAQ
itself, for that matter?

-- 
I'm a Lisp variable -- bind me!

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]