Folks,

The following program behaves as I would expect:

;; ------------------------------------------------------------------
#lang racket
(require (for-syntax racket/syntax))

(define-syntax (def-a/boxed-a stx)
  (syntax-case stx ()
    [(_ base-name base-val)
     (with-syntax
         ([box-name (format-id #'base-name #:source #'base-name
"~a-boxed" (syntax-e #'base-name))])
       #'(begin
           (define base-name base-val)
           (define box-name (box base-val))))]))


(def-a/boxed-a tim #;[1] "42")

tim #;[2]

tim-boxed #;[3]
;; ------------------------------------------------------------------

Prints:
"22"
'#&"22"

So the variables are defined (maybe that’s a bit of a naïve description
of what’s happened).

But... in DrRacket, I get a blue binding line from the tim at [2] to
the tim at [1]; however, I don’t get a line from tim-boxed at [3] to
the tim at [2].

Am I missing something?
I thought I had annotated the format-id with the necessary.

How does Racket know that tim is defined at [1], but not know that
tim-boxed is also defined (for my purposes) at [1]?

And, strictly, what do the blue lines indicate?


Some context:
I am actually using `prepare` to prepare some database queries. So I
have macros to define: find-a-thing-sql and find-a-thing-sql/prepared
For the most part I use find-a-thing-sql/prepared in my queries; so
*that* is what I want to jump back to the definition of using
"Jump to Binding Occurrence".

Thanks in advance,

Tim

-- 
Tim Brown CEng MBCS <tim.br...@cityc.co.uk>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                City Computing Limited · www.cityc.co.uk
      City House · Sutton Park Rd · Sutton · Surrey · SM1 2AE · GB
                T:+44 20 8770 2110 · F:+44 20 8770 2130
────────────────────────────────────────────────────────────────────────
City Computing Limited registered in London No:1767817.
Registered Office: City House, Sutton Park Road, Sutton, Surrey, SM1 2AE
VAT No: GB 918 4680 96

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

Reply via email to