chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] awk.egg question


From: felix winkelmann
Subject: Re: [Chicken-users] awk.egg question
Date: Tue, 27 Dec 2005 08:35:10 +0100

Hi, Patrick!

If the awk egg is installed correctly (chicken-setup -l), then
it should require regex, which has string-split-fields.

Can you add "-:d" to the script and send us the output?


cheers,
felix


On 12/27/05, Patrick Giagnocavo 717-201-3366 <address@hidden> wrote:
> I am trying to determine whether or not the awk.egg is working properly on my 
> system.
>
> Solaris/x86, Chicken 2.207
>
> Running
>
> cat /etc/passwd | csi -R awk -s awk-egg-test.scm
>
> Gets me a page and a half of traceback, starting with:
>
> Error: unbound variable: string-split-fields
>
> The file I am using, contains the "sort password" example from the awk.egg 
> web page:
>
> (require-extension awk)
>
> (define (read-passwd . port)
>   (let ([line (apply read-line port)])
>     (if (eof-object? line)
>         (values line #f)
>         (values line (string-split-fields ":" line #:infix)) ) ) )
>
> (for-each
>  (lambda (entry) (print (cdr entry)))
>  (sort
>   (awk (read-passwd) (line fields) ([ans '()])
>     (#t (cons (cons (car fields) line) ans)) )
>   (lambda (x y) (string<? (car x) (car y))) ) )
>
> (removing the require-extension line does not change the script's behavior)
>
> Suggestions, comments, code to try out welcome.
>
> Also, I suggest that tests be packaged along with the eggs (where 
> appropriate) that can be used to show that the egg is working as expected.
>
> Cordially
>
> Patrick Giagnocavo
> address@hidden
>
>
>
>
> _______________________________________________
> Chicken-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/chicken-users
>




reply via email to

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