Re: [racket-users] infix notation embedded in Racket
2015-04-24 14:44 GMT+02:00 Jens Axel Søgaard jensa...@soegaard.net: The arrows disappear when I use the at-exp syntax: @${b^2-4*a*x}. I am not sure why. Anyone? Thanks to Alexander for submitting a fix. /Jens Axel -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] infix notation embedded in Racket
2015-04-24 14:44 GMT+02:00 Jens Axel Søgaard jensa...@soegaard.net: The planet package took a *very* long time to install, so I intend to upload a version to pkg.racket-lang.org. The infix package is now available through pkg.racket-lang.org. /Jens Axel -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] infix notation embedded in Racket
2015-04-24 14:44 GMT+02:00 Jens Axel Søgaard jensa...@soegaard.net: The arrows disappear when I use the at-exp syntax: @${b^2-4*a*x}. I am not sure why. Anyone? I haven't figured it out yet, but it seems to have worked at some point. I have found this: (define-syntax ($ stx) (syntax-case stx () [(_ item ...) (let* ([from-at? (syntax-property stx 'scribble)]) (if from-at? ; reintroduce the original (discarded) indentation (with-syntax ([(item ...) (let loop ([items (syntax-list #'(item ...))]) (if (null? items) '() (let* ([fst (car items)] [prop (syntax-property fst 'scribble)] [rst (loop (cdr items))]) (cond [(eq? prop 'indentation) rst] [(not (and (pair? prop) (eq? (car prop) 'newline))) (cons fst rst)] [else (cons (datum-syntax fst (cadr prop) fst) rst)]]) #'($$ item ...)) #'($$ item ...)))])) -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] infix notation embedded in Racket
2015-04-24 0:18 GMT+02:00 Alexander D. Knauth alexan...@knauth.org: What’s wrong with at-exp though? I personally don’t like (planet soegaard/infix) as much mostly because the other options have the benefit of working with DrRacket features such as check-syntax arrows and blue-boxes, but that’s just because DrRacket is awesome, not because at-exp is bad. As it turns out, it is at-exp that are at fault. The screen shot below show that arrows and renaming works when using the infix packages with the syntax: ($ b^2-4*a*x) Note that it works even for identifiers inside the string. The arrows disappear when I use the at-exp syntax: @${b^2-4*a*x}. I am not sure why. Anyone? The planet package took a *very* long time to install, so I intend to upload a version to pkg.racket-lang.org. /Jens Axel -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
RE: [racket-users] infix notation embedded in Racket
Thanks, I take note of that. I was mislead by the examples in the infix docs of Jens Axel Søgaard. These examples start with #lang at-exp scheme. Sorry, my fault. Jos _ From: Alexander D. Knauth [mailto:alexan...@knauth.org] Sent: viernes, 24 de abril de 2015 12:59 To: Jos Koot Cc: Jens Axel Søgaard; racket-users@googlegroups.com Subject: Re: [racket-users] infix notation embedded in Racket On Apr 24, 2015, at 3:40 AM, Jos Koot jos.k...@gmail.com wrote: With respect to at-exp: I want my infix to be a simple macro that can be required within any arbitrary #lang racket module and cooperates well with all binding forms in that module. Well, since at-exp can be used with not only #lang racket but others as well (scheme, rackjure, clojure, afl, sweet-exp, basically anything that looks at the readtable), and doesn’t interfere with or require anything about the bindings, at-exp and (planet soegaard/infix) can be used with any arbitrary #lang whatever module as long as #lang whatever looks at the readtable and supports require. -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] infix notation embedded in Racket
On Apr 24, 2015, at 8:44 AM, Jens Axel Søgaard jensa...@soegaard.net wrote: As it turns out, it is at-exp that are at fault. The screen shot below show that arrows and renaming works when using the infix packages with the syntax: ($ b^2-4*a*x) Note that it works even for identifiers inside the string. Oh! Well that’s a pleasant surprise! I didn’t know that check-syntax arrows could point to “identifiers” within strings! The arrows disappear when I use the at-exp syntax: @${b^2-4*a*x}. I am not sure why. Anyone? I tried this and this worked with at-exp: #lang at-exp racket (require (for-syntax syntax/parse)) (define-syntax m (syntax-parser [(m str) (datum-syntax #'str (string-symbol (syntax-e #'str)) #'str #'str)])) (let ([x 5]) @m{x}) But that made me think of doing this: In main.ss, line 68, you use datum-syntax with three arguments, but it works if you add the fourth argument: (datum-syntax #'str (apply string-append (map syntax-datum (syntax-list #'(str str* ... (list (syntax-source #'str) line col pos (syntax-span #'str)) #'str) The planet package took a *very* long time to install, so I intend to upload a version to pkg.racket-lang.org. /Jens Axel infix.png -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.