Re: [racket-users] Re: How to make DrRacket interactions window use the same reader as the definitions window?

2020-05-29 Thread Thomas Dickerson
Jens - Interesting - does the default #%top-interaction behave differently from #%module-begin w.r.t. to a #lang's read? Right now my main.rkt is providing the standard #%module-begin, #%top-interaction, #%app, #%datum, and #%top, in addition to my language's functions + macros. Thanks! On Fri,

Re: [racket-users] Re: How to make DrRacket interactions window use the same reader as the definitions window?

2020-05-29 Thread Thomas Dickerson
user can configure the settings and all of the > language’s operations accept a setting. DrRacket maintains the current > settings for each language. > But it doesn't actually say *where* any of the relevant code is supposed to go. Any guidance from someone who knows their way around thes

Re: [racket-users] Re: How to make DrRacket interactions window use the same reader as the definitions window?

2020-05-29 Thread Thomas Dickerson
On Friday, May 29, 2020 at 11:29:38 AM UTC-4, Matthew Flatt wrote: > > DrRacket uses `pretty-print`, which will print numbers using > `number->string`, and so (I think) won't go through your parameter. > This sounds like a good lead - curious if this also applies to `write` and `display` as

[racket-users] Re: How to make DrRacket interactions window use the same reader as the definitions window?

2020-05-29 Thread Thomas Dickerson
On an apparently related note: I have modified Racket to allow parameterized control over how numbers are written/printed/displayed ( cf. https://github.com/racket/racket/pull/3222 ). This works fine from command-line racket, but DrRacket (installed using `raco pkg install -i drracket` of my

Re: [racket-users] What is the purpose of "compact" code paths in print.c?

2020-05-28 Thread Thomas Dickerson
Perfect, thanks for insight =) -- 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. To view this discussion on the web

[racket-users] What is the purpose of "compact" code paths in print.c?

2020-05-28 Thread Thomas Dickerson
I'm working on an enhancement for write/print/display, and thought I had it all implemented in io/print/main.rkt before realizing that code is only used for Racket-CS. Now I'm working on making equivalent changes in print.c for the traditional implementation, and that code is substantially

[racket-users] How to make DrRacket interactions window use the same reader as the definitions window?

2020-05-27 Thread Thomas Dickerson
I'm working on #lang with a custom reader (via read-table extension), that among other things, defines custom syntax for duodecimal numbers. My reader is working great in the definitions window / when I hut "Run" in DrRacket, and the top of the interaction window shows the name of my #lang,

Re: [racket-users] Re: C++ and pointer registration with 3M?

2019-11-01 Thread Thomas Dickerson
ner cases. > Thanks! -- Thomas Dickerson Founder // Chief Science Officer Geopipe, Inc. 802-458-0637 -- 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

Re: [racket-users] Re: C++ and pointer registration with 3M?

2019-11-01 Thread Thomas Dickerson
Great, this is very helpful. On Fri, Nov 1, 2019 at 4:53 PM Matthew Flatt wrote: > At Fri, 1 Nov 2019 10:34:50 -0700 (PDT), Thomas Dickerson wrote: > Only pointers to GCable memory --- which tends to be the things passed > to a Racket function, but more generally corresponds

[racket-users] Re: C++ and pointer registration with 3M?

2019-11-01 Thread Thomas Dickerson
register `env` or `data`, but we are seeing `scheme_embedded_load` in the stack trace of some Racket routines that triggered a watchpoint on memory that it shouldn't be touching, so I just wanted to double check that's indicative of a problem upstream. On Friday, November 1, 2019 at 1:34:50

[racket-users] C++ and pointer registration with 3M?

2019-11-01 Thread Thomas Dickerson
The documentation says: "The 3m collector needs to know the address of every local or temporary pointer within a function call at any point when a collection can be triggered." A couple questions: - Is this "every pointer which might be passed to a Racket function, or contain the result of a

Re: [racket-users] Help me understand FFI callouts in this context?

2019-10-31 Thread Thomas Dickerson
Hi Sage - Does your SIGSEGV MAPERR show up only while attached to a debugger? If so I noticed similar behavior while debugging my own project this week, and opened #2882 . It took me quite a bit of head scratching before I realized that (a) it only

Re: [racket-users] Efficient idiom for converting key-set of a hash-map into a hash-set

2019-10-30 Thread Thomas Dickerson
Hi Simon - Thanks for the detailed reply, my responses are in-line below. ~Thomas On Wed, Oct 30, 2019 at 7:52 AM Simon Schlee wrote: > Racket has mutable and immutable hash tables these are implemented > differently. > Because as a user of hash tables you have to differentiate between

Re: [racket-users] Efficient idiom for converting key-set of a hash-map into a hash-set

2019-10-29 Thread Thomas Dickerson
Hi All, Thanks for the information + various ideas. The various suggest constructs provide a helpful view on different corners of the language, but all appear to have the characteristic of throwing out the existing hashtable structure from the map and then reconstructing it from scratch for the

[racket-users] Efficient idiom for converting key-set of a hash-map into a hash-set

2019-10-25 Thread Thomas Dickerson
For reasons that are unclear to me, hash-keys and dict-keys both return a list? instead of a set? (frankly, this seems like a bug in the API...). Is there a something I can do that's more efficient than just calling list->set? -- You received this message because you are subscribed to the

Re: [racket-users] Re: Retina display for OpenGL

2019-08-14 Thread Thomas Dickerson
It seems like the issue here is not with the OpenGL setup, but with figuring out whether or not the draw context passed to a snip supports high-resolution drawing. Presumably the answer is "yes" somewhere in the pipeline, since the font rendering in the REPL doesn't look noticeably worse than

Re: [racket-users] Language-Specific Plugins: Toolbar button functionality to call drracket:eval:expand-program

2019-07-23 Thread Thomas Dickerson
On Tuesday, July 23, 2019 at 12:35:27 PM UTC-4, Thomas Dickerson wrote: > > > Yes - the architecture we eventually settled on is a main submodule that > does roughly this to get a black-box value which we can pass back to a > rendering function to produce a gl-bitmap, and sti

Re: [racket-users] Language-Specific Plugins: Toolbar button functionality to call drracket:eval:expand-program

2019-07-23 Thread Thomas Dickerson
On Tuesday, July 23, 2019 at 2:34:47 AM UTC-4, Robby Findler wrote: > > Sorry for letting this thread lapse. Wrt to your third option > mentioned below, would it work to make that option accessible via the > FFI? If so, then maybe you could make the "essentially phase shifted > everything"

Re: [racket-users] Re: Racket2 possibilities

2019-07-23 Thread Thomas Dickerson
A couple thoughts, not particularly well-organized, but in a more accessible form here than just tweeting at Alexis. In all this discussion of "parens-less LISP", I find it slightly odd that nobody has mentioned Logo yet. I'm ambivalent about surface syntax, but it's not like this is a

Re: [racket-users] Language-Specific Plugins: Toolbar button functionality to call drracket:eval:expand-program

2019-07-01 Thread Thomas Dickerson
On Mon, Jul 1, 2019 at 2:23 PM Philip McGrath wrote: > > I believe the main submodule will still be compiled the enclosing module > is loaded from source, but that should be trivial: it really only needs a > `require` and a function call. If the file has already been compiled to > bytecode, the

Re: [racket-users] Language-Specific Plugins: Toolbar button functionality to call drracket:eval:expand-program

2019-07-01 Thread Thomas Dickerson
Thanks for the responses. On Fri, Jun 28, 2019 at 5:50 PM Philip McGrath wrote: > If you're sure you want to get the raw program source and deal with it > manually, you can use the method `get-definitions-text >

Re: [racket-users] Jupyter Racket Kernel - iracket

2019-06-26 Thread Thomas Dickerson
Sorry - typo. that should be "Racket v7.3" On Wednesday, June 26, 2019 at 2:05:20 PM UTC-4, Thomas Dickerson wrote: > > Let's say you have DrRacket 7.3 installed. Then your raco and racket > executables are in "/Applications/Racket 7.3/bin". You can either spec

Re: [racket-users] Jupyter Racket Kernel - iracket

2019-06-26 Thread Thomas Dickerson
Let's say you have DrRacket 7.3 installed. Then your raco and racket executables are in "/Applications/Racket 7.3/bin". You can either specify the full path manually, or add that to your PATH by editing your .bashrc. On Wednesday, June 26, 2019 at 1:39:10 PM UTC-4, Arie Schlesinger wrote: > >

Re: [racket-users] Language-Specific Plugins: Toolbar button functionality to call drracket:eval:expand-program

2019-06-26 Thread Thomas Dickerson
Hi, Chiming in here, because Kshitij is working on this project for me. It sounds like Philip has answered (3) and most of (2). On Tuesday, June 25, 2019 at 10:06:07 PM UTC-4, Philip McGrath wrote: > > The functionality you describe—in particular, setting up clean evaluation > contexts—sounds a

Re: [racket-users] Correctly executing a source file from embedded Racket

2017-08-09 Thread Thomas Dickerson
cape-handling block, including multiple calls to `scheme_eval_string`. Also good to know, thanks. On Wednesday, July 26, 2017 at 11:09:48 AM UTC-4, Matthew Flatt wrote: > At Wed, 26 Jul 2017 07:54:32 -0700 (PDT), Thomas Dickerson wrote: > > One more thing: in terms of repeatedly exe

Re: [racket-users] Correctly executing a source file from embedded Racket

2017-07-26 Thread Thomas Dickerson
On Wednesday, July 26, 2017 at 11:09:48 AM UTC-4, Matthew Flatt wrote: > At Wed, 26 Jul 2017 07:54:32 -0700 (PDT), Thomas Dickerson wrote: > > One more thing: in terms of repeatedly executing scripts, does it make > > sense > > to set up and tear down the interpreter eve

Re: [racket-users] Correctly executing a source file from embedded Racket

2017-07-26 Thread Thomas Dickerson
Thanks for the help, a couple more quick questions: On Wednesday, July 26, 2017 at 9:15:12 AM UTC-4, Matthew Flatt wrote: > You don't have to populate the top-level environment with > `racket/base`. You could instead use > > scheme_namespace_require(scheme_intern_symbol("my-lang")) > > where

Re: [racket-users] Correctly executing a source file from embedded Racket

2017-07-25 Thread Thomas Dickerson
On Tuesday, July 25, 2017 at 5:52:45 PM UTC-4, Shu-Hung You wrote:> > As we can see, > `scheme_namespace_require(scheme_intern_symbol("racket/base"));` > is actually missing from your setup program. This line requires racket > base and the usual #%app bindings. It's probably needed even if

[racket-users] Correctly executing a source file from embedded Racket

2017-07-25 Thread Thomas Dickerson
I've been working on building a DSL in Racket (as a #lang collection), and have reached the stage where it's functioning as expected and ready to be embedded in my application (which is written in C++). I have modified the `run` function from the embedding example here

[racket-users] (syntax-local-make-definition-context intdef-ctx) inexplicably sheds bindings

2015-11-20 Thread Thomas Dickerson
I have a code that looks like this: (emit-local-step #'func.name (internal-definition-context-apply/loc defs #'func.name) #:id #'defun) (let ([defs (syntax-local-make-definition-context defs)] [ctx (build-expand-context ctx)] [args (parse-arg-names #'func.args)])

Re: [racket-users] syntax-original? always returns #f within syntax transformers?

2015-11-12 Thread Thomas Dickerson
On Thursday, November 12, 2015 at 12:26:23 PM UTC-5, Matthew Flatt wrote: > The macro stepper shows a form after expansion, while Alexis's example > was looking at it during expansion (i.e., in the dynamic extent of a > syntax transformer). Those different times have different syntax > objects

Re: [racket-users] syntax-original? always returns #f within syntax transformers?

2015-11-11 Thread Thomas Dickerson
On Tuesday, October 27, 2015 at 7:24:55 AM UTC-4, Matthew Flatt wrote: > This role of marks has been taken over by macro-introduction scopes, so > that's still the explanation. A macro-introduction scope is added to > the right places by first adding it everywhere to the argument to a > macro

Re: [racket-users] Correct use of pattern-expander (example in docs is broken)

2015-11-11 Thread Thomas Dickerson
On Tuesday, November 10, 2015 at 10:38:35 PM UTC-5, Alex Knauth wrote: > Ok, I just opened https://github.com/racket/racket/pull/1133, which fixes > this so that syntax-rules still works. Awesome! > > On Nov 10, 2015, at 6:19 PM, Alex Knauth wrote: > > This works though:

[racket-users] Correct use of pattern-expander (example in docs is broken)

2015-11-10 Thread Thomas Dickerson
The docs (http://docs.racket-lang.org/syntax/stxparse-patterns.html#%28def._%28%28lib._syntax%2Fparse..rkt%29._pattern-expander%29%29) give an example, ~maybe, that doesn't actually work: > (define-syntax ~maybe (pattern-expander (syntax-rules () [(~maybe pat ...)

Re: [racket-users] Macro-introducing macros with inter-macro communication channel

2015-06-23 Thread Thomas Dickerson
Jun 2015 02:13:19 -0400, Thomas Dickerson wrote: I seem to be missing some key ingredient here. The following really simply test-case, using let-syntaxes, works as expected: (define-syntax my-def-stx (lambda (stx) (syntax-case stx (my-def-stx) [(my-def-stx (id ...) rhs

Re: [racket-users] Macro-introducing macros with inter-macro communication channel

2015-06-23 Thread Thomas Dickerson
problems, but if someone could explain what changes would need to be made to the local-expand call for that to work, I'd be grateful (for my own understanding). Thomas Dickerson Brown University Department of Computer Science 115 Waterman St, 4th Floor Providence, RI 02912 802-458-0637 On Tue

Re: [racket-users] Macro-introducing macros with inter-macro communication channel

2015-06-23 Thread Thomas Dickerson
I thought that might be the case, but the documentation is pretty dense (and self-referential), so it's not clear what the correct value for that argument is. Thomas Dickerson Brown University Department of Computer Science 115 Waterman St, 4th Floor Providence, RI 02912 802-458-0637 On Tue

Re: [racket-users] Macro-introducing macros with inter-macro communication channel

2015-06-23 Thread Thomas Dickerson
#f intdef))]))) (my-def-stx (i j) (values (lambda (stx) #'3) (lambda (stx) #'4)) (+ i j)) instead, gives me i: undefined; cannot reference an identifier before its definition. Thomas Dickerson Brown University Department of Computer Science 115 Waterman St, 4th Floor Providence, RI 02912

Re: [racket-users] Macro-introducing macros with inter-macro communication channel

2015-06-22 Thread Thomas Dickerson
to introduce expand-time names without introducing wrapping let-syntaxes (or similar) forms around my body code. On Saturday, June 20, 2015 at 2:24:40 PM UTC-4, Alex Knauth wrote: On Jun 19, 2015, at 7:44 PM, Thomas Dickerson thomas_dicker...@brown.edu wrote: I was intending for that example

Re: [racket-users] Macro-introducing macros with inter-macro communication channel

2015-06-22 Thread Thomas Dickerson
:35:50 PM UTC-4, Thomas Dickerson wrote: Thanks for the effort that went into figuring that out! A couple first thoughts on the implementation: To first order, this is exactly what I want to be able to do (and it elegantly avoids local-expand by reasoning about expansion order); however

Re: [racket-users] Macro-introducing macros with inter-macro communication channel

2015-06-19 Thread Thomas Dickerson
a (let ([x 0] [y 0] [z 0]) ….) for you instead? On Jun 19, 2015, at 5:58 PM, Thomas Dickerson thomas_d...@brown.edu wrote: Sure, here's a toy example. This code: (Loop 10   (begin     (define-values   [dx dy dz]   (values 0 0 0))     ; Some

Re: [racket-users] Macro-introducing macros with inter-macro communication channel

2015-06-19 Thread Thomas Dickerson
it appears. Thomas Dickerson Brown University Department of Computer Science 115 Waterman St, 4th Floor Providence, RI 02912 802-458-0637 On Fri, Jun 19, 2015 at 3:22 PM, Ryan Culpepper ry...@ccs.neu.edu wrote: On 06/19/2015 03:07 PM, Thomas Dickerson wrote: Hi All, I'm trying to figure out how

[racket-users] Macro-introducing macros with inter-macro communication channel

2015-06-19 Thread Thomas Dickerson
Hi All, I'm trying to figure out how best to implement the following pattern of macro behavior: Let's say we are writing Loop macro that implements a looped computation over a specified body. I would like to then be able to (a) introduce additional Loop-specific macros that are defined only