Re: [Chicken-users] Strange problems with args egg

2013-08-06 Thread Jim Ursetto
No problem. The fix is now in args 1.4.4.

On Aug 5, 2013, at 21:54, Jonathan Chan j...@fastmail.fm wrote:

 Sorry for the delayed reply - I missed your message for some reason. The
 patch does work! Thanks for the help and for the useful egg.
 
 -- 
 Jonathan Chan
 
 On Sun, Aug 4, 2013, at 06:43 AM, Jim Ursetto wrote:
 Did you try my patch?  You don't have to rewrite anything, it's a bug in
 the args egg.
 
 On Aug 4, 2013, at 2:13 AM, Jonathan Chan j...@fastmail.fm wrote:
 
 Thank you for the help! This is definitely a very interesting language to 
 learn.
 
 On 08/03/2013 09:06 AM, John Cowan wrote:
 Jonathan Chan scripsit:
 
 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))
 [...]
 
 The strange thing is that h and help seem to have turned into (h390
 help391), causing problems.
 This is not a Chicken-specific problem, but a general problem
 with non-hygienic macros.  You are using the non-hygienic macro
 args:make-option within a hygienic macro.  The syntax-rules transformer
 doesn't know that h and help are being used literally here (because
 it cannot tell what args:make-option does), so it systematically renames
 them to avoid collisions.
 
 Is there something I need to change to fix the problem? Sorry for many
 misunderstandings.
 You can rewrite test as a non-hygienic (explicit renaming or implicit
 renaming) macro.
 
 -- 
 Jonathan Chan
 j...@fastmail.fm
 
 
 ___
 Chicken-users mailing list
 Chicken-users@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/chicken-users
 

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Strange problems with args egg

2013-08-05 Thread Jonathan Chan
Sorry for the delayed reply - I missed your message for some reason. The
patch does work! Thanks for the help and for the useful egg.

-- 
Jonathan Chan

On Sun, Aug 4, 2013, at 06:43 AM, Jim Ursetto wrote:
 Did you try my patch?  You don't have to rewrite anything, it's a bug in
 the args egg.
 
 On Aug 4, 2013, at 2:13 AM, Jonathan Chan j...@fastmail.fm wrote:
 
  Thank you for the help! This is definitely a very interesting language to 
  learn.
  
  On 08/03/2013 09:06 AM, John Cowan wrote:
  Jonathan Chan scripsit:
  
  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))
  
  [...]
  
  The strange thing is that h and help seem to have turned into (h390
  help391), causing problems.
  This is not a Chicken-specific problem, but a general problem
  with non-hygienic macros.  You are using the non-hygienic macro
  args:make-option within a hygienic macro.  The syntax-rules transformer
  doesn't know that h and help are being used literally here (because
  it cannot tell what args:make-option does), so it systematically renames
  them to avoid collisions.
  
  Is there something I need to change to fix the problem? Sorry for many
  misunderstandings.
  You can rewrite test as a non-hygienic (explicit renaming or implicit
  renaming) macro.
  
  
  -- 
  Jonathan Chan
  j...@fastmail.fm
  
  
  ___
  Chicken-users mailing list
  Chicken-users@nongnu.org
  https://lists.nongnu.org/mailman/listinfo/chicken-users
 

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Strange problems with args egg

2013-08-04 Thread Jonathan Chan
Thank you for the help! This is definitely a very interesting language 
to learn.


On 08/03/2013 09:06 AM, John Cowan wrote:

Jonathan Chan scripsit:


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))


[...]


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

This is not a Chicken-specific problem, but a general problem
with non-hygienic macros.  You are using the non-hygienic macro
args:make-option within a hygienic macro.  The syntax-rules transformer
doesn't know that h and help are being used literally here (because
it cannot tell what args:make-option does), so it systematically renames
them to avoid collisions.


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

You can rewrite test as a non-hygienic (explicit renaming or implicit
renaming) macro.



--
Jonathan Chan
j...@fastmail.fm


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Strange problems with args egg

2013-08-04 Thread Jim Ursetto
Did you try my patch?  You don't have to rewrite anything, it's a bug in the 
args egg.

On Aug 4, 2013, at 2:13 AM, Jonathan Chan j...@fastmail.fm wrote:

 Thank you for the help! This is definitely a very interesting language to 
 learn.
 
 On 08/03/2013 09:06 AM, John Cowan wrote:
 Jonathan Chan scripsit:
 
 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))
 
 [...]
 
 The strange thing is that h and help seem to have turned into (h390
 help391), causing problems.
 This is not a Chicken-specific problem, but a general problem
 with non-hygienic macros.  You are using the non-hygienic macro
 args:make-option within a hygienic macro.  The syntax-rules transformer
 doesn't know that h and help are being used literally here (because
 it cannot tell what args:make-option does), so it systematically renames
 them to avoid collisions.
 
 Is there something I need to change to fix the problem? Sorry for many
 misunderstandings.
 You can rewrite test as a non-hygienic (explicit renaming or implicit
 renaming) macro.
 
 
 -- 
 Jonathan Chan
 j...@fastmail.fm
 
 
 ___
 Chicken-users mailing list
 Chicken-users@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] Strange problems with args egg

2013-08-03 Thread Jonathan Chan
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
j...@fastmail.fm

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Strange problems with args egg

2013-08-03 Thread Jim Ursetto
This patch to the args egg should fix things -- could you try it?
Jim
Index: args.scm
===
--- args.scm(revision 29488)
+++ args.scm(working copy)
@@ -268,7 +268,7 @@
  )
 
   (let* ((srfi37-names (map (lambda (name)
- (let ((str (-string name)))
+ (let ((str (symbol-string (strip-syntax 
name
(if (= (string-length str) 1)
(string-ref str 0)
str)))


On Aug 3, 2013, at 6:56 AM, Jonathan Chan j...@fastmail.fm wrote:

 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
 j...@fastmail.fm
 
 ___
 Chicken-users mailing list
 Chicken-users@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/chicken-users

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users