logo       

awk.egg question: msg#00102

lisp.scheme.chicken

Subject: awk.egg question

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
patrick@xxxxxxxx


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise