Re: syntax-local-value patch for discussion

2012-01-26 Thread Stefan Israelsson Tampe
Remember it's not symbols but code objects that this refers to so I need to use the syntactic information and only augment the objects that can be joined and leave the other syntactic objects like symbols from another module and so on. I will try to leave the struct representation and use only lis

Re: syntax-local-value patch for discussion

2012-01-26 Thread Andy Wingo
Hi Stefan, On Mon 23 Jan 2012 17:06, Stefan Israelsson Tampe writes: > and when parse is ready to unpack S we could have > > S = #(syntax-object # wrap-part hygiene) > > Now I basically solve this problem by constructing Why do syntax->datum and datum->syntax not work for you to pack and unpac

Re: syntax-local-value patch for discussion

2012-01-23 Thread Stefan Israelsson Tampe
Ok, here is a discussoin using code in syntax-parse. Let's start with the defintion of a syntax-class, str in the macro package syntax-parse: (define-syntax-class str #:attributes () #:opaque #:commit #:description "string" (pattern (~and x (~fail #:unless (string? (syntax-e #'x)) So the

Re: syntax-local-value patch for discussion

2012-01-23 Thread Andy Wingo
Hi Stefan, On Thu 19 Jan 2012 10:50, Stefan Israelsson Tampe writes: > Working on porting syntax-parse is a learning experience and I know > understand how it uses syntax-local-value as a way to lookup a syntax > object by joining the wraps together with the total wrap at the macro > call. syn

Re: syntax-local-value patch for discussion

2012-01-19 Thread Stefan Israelsson Tampe
Hi, Working on porting syntax-parse is a learning experience and I know understand how it uses syntax-local-value as a way to lookup a syntax object by joining the wraps together with the total wrap at the macro call. The question is if this really are the total wrap e.g. contains the history of

Re: syntax-local-value patch for discussion

2012-01-14 Thread Stefan Israelsson Tampe
Ok, I have tried follow your suggestion, here is what I could make, (with-fluids ((*macro-lookup* (lambda (e) (cond ((number? e) (pk w)) ((symbol? e)

Re: syntax-local-value patch for discussion

2012-01-08 Thread Stefan Israelsson Tampe
Thanks for taking time to help with this! On Sun, Jan 8, 2012 at 8:15 PM, Mark H Weaver wrote: > Hi Stefan, > > Stefan Israelsson Tampe writes: > > diff --git a/module/ice-9/psyntax.scm b/module/ice-9/psyntax.scm > > index e522f54..70463a5 100644 > > --- a/module/ice-9/psyntax.scm > > +++ b/mod

Re: syntax-local-value patch for discussion

2012-01-08 Thread Mark H Weaver
Hi Stefan, Stefan Israelsson Tampe writes: > diff --git a/module/ice-9/psyntax.scm b/module/ice-9/psyntax.scm > index e522f54..70463a5 100644 > --- a/module/ice-9/psyntax.scm > +++ b/module/ice-9/psyntax.scm > @@ -155,6 +155,10 @@ > (eval-when (compile) >(set-current-module (resolve-module '

Re: syntax-local-value patch for discussion

2012-01-08 Thread Stefan Israelsson Tampe
On Sat, Jan 7, 2012 at 1:05 AM, Andy Wingo wrote: > On Mon 05 Dec 2011 19:12, Stefan Israelsson Tampe > writes: > > > (define-syntax info > > (lambda (x) > > (syntax-case x () > > ((_ x) > > (pk (syntax-binding-info (syntax->datum #'x))) > > #'#f > > I agree with

Re: syntax-local-value patch for discussion

2012-01-06 Thread Andy Wingo
On Mon 05 Dec 2011 19:12, Stefan Israelsson Tampe writes: > (define-syntax info >   (lambda (x) >     (syntax-case x () >   ((_ x) >     (pk (syntax-binding-info (syntax->datum #'x))) >     #'#f I agree with Ian that we should be operating on syntax objects here, not on datums.

Re: syntax-local-value patch for discussion

2011-12-09 Thread Stefan Israelsson Tampe
Hi, On Thu, Dec 8, 2011 at 10:58 PM, Ian Price wrote: > Stefan Israelsson Tampe writes: > > > So I tried to get hold of the macro binding. So with the following patch > wich should be enogh > > for me to make progress porting rackets syntax parse to guile. > > > > Would be very glad if we could

Re: syntax-local-value patch for discussion

2011-12-08 Thread Ian Price
Stefan Israelsson Tampe writes: > So I tried to get hold of the macro binding. So with the following patch wich > should be enogh > for me to make progress porting rackets syntax parse to guile. > > Would be very glad if we could find a interface to expose this information > that is sane > and

syntax-local-value patch for discussion

2011-12-05 Thread Stefan Israelsson Tampe
So I tried to get hold of the macro binding. So with the following patch wich should be enogh for me to make progress porting rackets syntax parse to guile. Would be very glad if we could find a interface to expose this information that is sane and rigid manner. So we should discuss this feature.