From: Andy Wingo Date: Fri, 24 Jul 2009 10:06:19 +0000 (+0200) Subject: fix gensym creation in psyntax X-Git-Url: http://git.hcoop.net/bpt/guile.git/commitdiff_plain/d95eb7f49f721306ffeb0020724093929cb0e206 fix gensym creation in psyntax * module/ice-9/psyntax.scm (build-lexical-var): Make our gensyms really unique. Before, there was a chance that different lexicals could result in the same gensym. * module/ice-9/psyntax-pp.scm: Regenerate. --- diff --git a/module/ice-9/psyntax-pp.scm b/module/ice-9/psyntax-pp.scm index 113269b2e..de0db95de 100644 --- a/module/ice-9/psyntax-pp.scm +++ b/module/ice-9/psyntax-pp.scm @@ -54,7 +54,8 @@ (let ((id293 (if (syntax-object?99 id292) (syntax-object-expression100 id292) id292))) - (gensym (symbol->string id293))))) + (gensym + (string-append (symbol->string id293) " "))))) (strip161 (lambda (x294 w295) (if (memq (quote top) (wrap-marks118 w295)) diff --git a/module/ice-9/psyntax.scm b/module/ice-9/psyntax.scm index f1f6e9ae0..6ecf24ee6 100644 --- a/module/ice-9/psyntax.scm +++ b/module/ice-9/psyntax.scm @@ -1,6 +1,6 @@ ;;;; -*-scheme-*- ;;;; -;;;; Copyright (C) 2001, 2003, 2006 Free Software Foundation, Inc. +;;;; Copyright (C) 2001, 2003, 2006, 2009 Free Software Foundation, Inc. ;;;; ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -529,10 +529,10 @@ `(letrec ,(map list vars val-exps) ,body-exp) src)))))) -;; FIXME: wingo: use make-lexical ? +;; FIXME: use a faster gensym (define-syntax build-lexical-var (syntax-rules () - ((_ src id) (gensym (symbol->string id))))) + ((_ src id) (gensym (string-append (symbol->string id) " "))))) (define-structure (syntax-object expression wrap module))