chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] Strange problems with args egg


From: Jonathan Chan
Subject: [Chicken-users] Strange problems with args egg
Date: Sat, 03 Aug 2013 04:56:15 -0700

Hello all,

First off, I am very new to Chicken. I recently tried using the args egg
and wrote a syntax-rules macro to let me clarify a bunch of copy-paste
declarations, but seem to be running into some strange problem where
numbers are appended to the names of certain symbols.

Here is the smallest amount of args-using Chicken that will cause the
problem:

(define-syntax test
  (syntax-rules ()
    ((test)
     (begin
       (define opts (list (args:make-option (h help) #:none "display
       this text" (print "foo"))))
       (write (args:parse (command-line-arguments) opts))))))

(test)

... and to a local copy I made of the args egg I added the following at
the beginning of the definition of the args:parse function (included):

(define (args:parse args options-list . optionals)
  (for-each (lambda (o)
              (write (option-names (args:option-option o))))
            options-list)
  (newline)

The strange thing is that h and help seem to have turned into ("h390"
"help391"), causing problems.

Is there something I need to change to fix the problem? Sorry for many
misunderstandings.

Here is the Chicken version I am running:

CHICKEN
(c) 2008-2013, The Chicken Team
(c) 2000-2007, Felix L. Winkelmann
Version 4.8.0.4 (stability/4.8.0) (rev 578619b)
linux-unix-gnu-x86-64 [ 64bit manyargs dload ptables ]
compiled 2013-07-15 on aeryn.xorinia.dim (Darwin)

Thanks,
-- 
Jonathan Chan
address@hidden



reply via email to

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