Re: [racket-users] HtDP Tool Linklet Instantiation Error

2021-01-06 Thread Shu-Hung You
Some update:

Hopefully this is the same issue as the one reported at
https://github.com/racket/racket/issues/3604 and that the commit
https://github.com/racket/drracket/commit/3a07fc0319097661d27ea05ba42634f2b5ae14dd
fixes it.

On Sun, Jun 17, 2018 at 10:15 PM Shu-Hung You
 wrote:
>
> No, this happened even after I did `raco setup`
>
> On Sun, Jun 17, 2018 at 9:47 PM, Robby Findler
>  wrote:
> > Are you editing the files (and not running "raco setup")?
> >
> > Robby
> >
> >
> > On Sun, Jun 17, 2018 at 11:16 AM, Shu-Hung You
> >  wrote:
> >> Does anyone ever get random HtDP plugin linklet instantiation error at
> >> DrRacket startup? I sometimes get these errors, but they would
> >> disappear if I restart DrRacket a few times. The modules that trigger
> >> the errors seem arbitrary too.
> >>
> >> instantiate-linklet: mismatch;
> >>  reference to a variable that is unintialized;
> >>  possibly, bytecode file needs re-compile because dependencies changed
> >>   name: idY365.1
> >>   exporting instance: "/racket/collects/syntax/id-table.rkt"
> >>   importing instance: 
> >> "/racket/collects/racket/match/struct.rkt"
> >>
> >>
> >>
> >> Error invoking tool
> >> #/racket/share/pkgs/htdp-lib/lang>;"htdp-langs.rkt"
> >>
> >> instantiate-linklet: mismatch;
> >>  reference to a variable that is unintialized;
> >>  possibly, bytecode file needs re-compile because dependencies changed
> >>   name: make-fun-syntax
> >>   exporting instance: "/racket/collects/ffi/unsafe.rkt"
> >>   importing instance:
> >> "/racket/share/pkgs/draw-lib/racket/draw/unsafe/cairo.rkt"
> >>
> >>
> >>
> >> Error invoking tool
> >> #/racket/share/pkgs/htdp-lib/lang>;"htdp-langs.rkt"
> >>
> >> instantiate-linklet: mismatch;
> >>  reference to a variable that is unintialized;
> >>  possibly, bytecode file needs re-compile because dependencies changed
> >>   name: idX48.1
> >>   exporting instance: "/racket/collects/racket/dict.rkt"
> >>   importing instance:
> >> "/racket/collects/syntax/parse/lib/function-header.rkt"
> >> instantiate-linklet: mismatch;
> >>  reference to a variable that is unintialized;
> >>  possibly, bytecode file needs re-compile because dependencies changed
> >>   name: parse-function-header1.1
> >>   exporting instance:
> >> "/racket/collects/syntax/parse/lib/function-header.rkt"
> >>   importing instance: 
> >> "/racket/collects/racket/match/match.rkt"
> >>
> >>
> >>
> >> Error invoking tool
> >> #/racket/share/pkgs/htdp-lib/lang>;"htdp-langs.rkt"
> >>
> >> instantiate-linklet: mismatch;
> >>  reference to a variable that is unintialized;
> >>  possibly, bytecode file needs re-compile because dependencies changed
> >>   name: idY365.1
> >>   exporting instance: "/racket/collects/syntax/id-table.rkt"
> >>   importing instance: 
> >> "/racket/collects/racket/match/struct.rkt"
> >>
> >>
> >> The error contexts are like:
> >>
> >>   context...:
> >>for-loop
> >>run-module-instance!125
> >>for-loop
> >>loop
> >>[repeats 1 more time]
> >>expand-capturing-lifts
> >>loop
> >>.../racket/unit.rkt:1001:20
> >>
> >> /extra-pkgs/drracket/drracket/drracket/private/tools-drs.rkt:56:0:
> >> invoke-drs-tool
> >>.../more-scheme.rkt:261:28
> >>
> >> /extra-pkgs/drracket/drracket/drracket/private/tools.rkt:72:0:
> >> load/invoke-all-tools
> >>.../racket/unit.rkt:1001:20
> >>"/extra-pkgs/drracket/drracket/drracket/tool-lib.rkt":
> >> [running body]
> >>for-loop
> >>run-module-instance!125
> >>
> >> "/extra-pkgs/drracket/drracket/drracket/private/drracket-normal.rkt":
> >> [running body]
> >>...
> >>
> >>   context...:
> >>for-loop
> >>run-module-instance!125
> >>for-loop
> >>loop
> >>[repeats 1 more time]
> >>expand-capturing-lifts
> >>loop
> >>.../racket/unit.rkt:1001:20
> >>
> >> /extra-pkgs/drracket/drracket/drracket/private/tools-drs.rkt:56:0:
> >> invoke-drs-tool
> >>.../more-scheme.rkt:261:28
> >>
> >> /extra-pkgs/drracket/drracket/drracket/private/tools.rkt:72:0:
> >> load/invoke-all-tools
> >>.../racket/unit.rkt:1001:20
> >>"/extra-pkgs/drracket/drracket/drracket/tool-lib.rkt":
> >> [running body]
> >>for-loop
> >>run-module-instance!125
> >>
> >> "/extra-pkgs/drracket/drracket/drracket/private/drracket-normal.rkt":
> >> [running body]
> >>...
> >>
> >>   context...:
> >>for-loop
> >>run-module-instance!125
> >>for-loop
> >>[repeats 1 more time]
> >>run-module-instance!125
> >>for-loop
> >>[repeats 1 more time]
> >>run-module-instance!125
> >>for-loop
> >>[repeats 1 more time]
> >>run-module-instance!125
> >>for-loop
> >>[repeats 1 more time]
> >>run-module-instance!125
> >>for-loop
> >>[repeats 1 more time]
> >>...
> >>
> >> --
> >> 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] I made some videos about Racket (a.k.a the return of Playing the Game with PLT Redex)

2021-01-06 Thread Michael Ballantyne
> ... to embed domain specific language in another. Does Racket have any 
support for this?

One approach is discussed in our paper about making macro-extensible 
DSLs: https://dl.acm.org/doi/abs/10.1145/3428297
Section 8 shows some examples of how extensibility is useful for layering 
higher-level DSLs atop lower-level DSLs and for integrating DSLs together.
On Wednesday, January 6, 2021 at 5:27:22 AM UTC-5 wanp...@gmail.com wrote:

> Thanks for sharing.
> I think you did mention an interesting idea, to embed domain specific 
> language in another.
> Does Racket have any support for this?
>
> Leandro Facchinetti  於 2021年1月6日 週三 上午3:20寫道:
>
>> Thanks to everyone who responded (privately and otherwise) for the nice 
>> words.
>>
>> Sage Gerard: To each its own. I’m glad to hear that you have these 
>> success cases with Racket 
>>
>> -- 
>>
> 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...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/racket-users/ae894452-fb5c-45c1-86f1-f6b228a3c73dn%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> - sleepnova
> 呼叫小黃創辦人 & CEO
>

-- 
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 visit 
https://groups.google.com/d/msgid/racket-users/389094f6-35ba-4455-bba1-3cf6b140aeean%40googlegroups.com.


[racket-users] GUI button% string label keyboard mnemonics

2021-01-06 Thread Dominik Pantůček
Hello Racketeers,

it's been a while since I was doing some serious GUI work but for one of
my current work projects the time has come and surprise surprise -
troubles on the way :)

When a button is created like:

(new button% (label "") ...)

everything works as expected. The #\q key becomes a keyboard shortcut
that triggers the callback correctly.

But when the string label is given in the list of icon and label like:

(new button% (label (close-icon) "" 'left) ...)

The "&" is left intact and no action is triggered by pressing the #\q
character on the keyboard.

The documentation clearly states both alternatives as supported: "If &
occurs in label (when label includes a string), it is specially parsed;
...". Am I doing something wrong or is it a bug?

If I look at the right source for my platform -
gui-lib/mred/private/wx/gtk/button (Linux/X11/Gtk), in both cases
gtk_new_with_mnemonic is used. Seems OK to me.

Any ideas what I might have overlooked?


Cheers,
Dominik

-- 
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 visit 
https://groups.google.com/d/msgid/racket-users/64893a3c-e8c2-b007-9879-35138bbd4512%40trustica.cz.


[racket-users] Re: Racket News - Happy New Year Issue 44

2021-01-06 Thread Paulo Matos
Hi again,

A problem with the datasets meant that in the first few hours after 
publishing, the plots reflected incorrect values. This is now fixed. Thanks 
to Sorawee for noticing and pointing it out to me.

Paulo

On Wednesday, 6 January 2021 at 11:34:04 UTC+1 Paulo Matos wrote:

> Happy new year everyone,
>
> It is with great joy that I publish the first issue of the year.
> Issue 44: https://racket-news.com/2021/01/racket-news-issue-44.html
>
> That's our longest issue ever. Not everything could be included as I 
> always try the issues to be quick to read (over a coffee break) but this 
> one might need an extra long coffee.
>
> Lets make 2021 the year of Racket! Up, Up, and Away!
> -- 
> Paulo Matos
>

-- 
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 visit 
https://groups.google.com/d/msgid/racket-users/93836fa4-db47-439f-aaef-9077a1b5f1efn%40googlegroups.com.


Re: [racket-users] Tools and Syntax Highlighting

2021-01-06 Thread Stephen De Gabrielle
Glad to hear it!

On Wed, Jan 6, 2021 at 8:10 AM Ben Ryjikov  wrote:

> Hi Robby and Stephen,
>
> Thanks for your suggestions! It’s working now thanks to a mix of rackunit
> tools and dynamic require.
> We’re also thinking about how to make our code less reliant on DrRacket.
>
> Best,
> Ben
>
> On Jan 4, 2021, at 8:11 PM, Robby Findler 
> wrote:
>
> I think a good first question here is "what do you want to happen when you
> are running the program from outside DrRacket?". DrRacket is, in a general
> sense, designed to reflect extra information about how a program runs when
> it can glean that information, but it isn't meant to be the only way that
> Racket programs run, merely one of them. So what you want to think about
> is: how can a program offer up information about itself (and what
> APIs/values/data should that be)? and then: how can DrRacket (or other
> things that run Racket programs, eg Racket Mode, or command-line racket or
> a standalone executable, etc) get a hold of that information to show it in
> a meaningful way?
>
> There are some examples of success following generally this pattern: test
> coverage is a means whereby a program is expanded, then instrumented by
> some tool (via rewriting the program) such that the instrumented program
> produces information about what parts of the program actually ran to its
> context (which might be DrRacket but might also be the "cover" library).
> Check Syntax (which runs automatically these days) expands the program and
> records information about it (notably binding and bound occurrences of
> variables) and then DrRacket and Emacs Mode let you work with that
> information.
>
> Robby
>
>
>
> On Mon, Jan 4, 2021 at 1:46 PM Ben Ryjikov  wrote:
>
>> I’m sorry - I didn’t explain what kind of highlighting we’re looking for.
>>
>> We’re building a new #lang, and we want it so that sometimes when you
>> run, DrRacket highlights a part of the program you are running. But we only
>> want that in certain situations, so we want to create a function which we
>> can call that would do the highlighting on demand.
>>
>> Are there any functions or libraries which can do that?
>>
>> We’ve managed to get highlighting through a tool (which is listed in
>> info.rkt), but we’re struggling to get it on demand because we can’t easily
>> find a way for the tool and the program to share code.
>>
>> Is there a way for a tool to access code which outside of the tool at
>> runtime?
>>
>> -Ben
>>
>> On Jan 4, 2021, at 9:04 AM, Stephen De Gabrielle 
>> wrote:
>>
>> On Mon, Jan 4, 2021 at 12:32 AM Ben Ryjikov  wrote:
>>
>>> Hi Racket,
>>>
>>> Is it possible for a tool invoked by info.rkt to access code which is
>>> outside of the tool?
>>>
>>> We’re building a #lang and would like to have on-demand syntax
>>> highlighting.
>>> We’ve tried using a tool, and have successfully made a button and a menu
>>> item that do it, but we’d like to activate the highlighting
>>> programmatically at runtime instead of by clicking on something.
>>> We also are hoping to have multiple highlights at once if possible.
>>>
>>> Is there any way to get on-demand syntax highlighting without using a
>>> button or menu item? Are there any pre-existing Racket tools or functions
>>> that would do this?
>>>
>>
>> I think datalog does this;
>>
>> 
>>
>>
>>
>>
>>>
>>> Thanks for your time and Happy New Year!
>>>
>>> Best,
>>> Ben
>>>
>>> --
>>> 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 visit
>>> https://groups.google.com/d/msgid/racket-users/BA1B6C4F-8172-462F-9E2D-8F6F2A9C6BB4%40gmail.com
>>> .
>>>
>>
>>
>> --
>> 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 visit
>> https://groups.google.com/d/msgid/racket-users/C549A2BB-8999-496B-B119-70239EB13EDB%40gmail.com
>> 
>> .
>>
>
>

-- 
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 visit 
https://groups.google.com/d/msgid/racket-users/CAGHj7-%2B8cDusQHV19YS7rv1i_NXzUosUscENahDG5PJycK3iCw%40mail.gmail.com.


[racket-users] Racket News - Happy New Year Issue 44

2021-01-06 Thread Paulo Matos
Happy new year everyone,

It is with great joy that I publish the first issue of the year.
Issue 44: https://racket-news.com/2021/01/racket-news-issue-44.html

That's our longest issue ever. Not everything could be included as I always 
try the issues to be quick to read (over a coffee break) but this one might 
need an extra long coffee.

Lets make 2021 the year of Racket! Up, Up, and Away!
-- 
Paulo Matos

-- 
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 visit 
https://groups.google.com/d/msgid/racket-users/f6a2ae54-d808-42e4-bfd8-4e25084085d8n%40googlegroups.com.


Re: [racket-users] I made some videos about Racket (a.k.a the return of Playing the Game with PLT Redex)

2021-01-06 Thread sleepnova
Thanks for sharing.
I think you did mention an interesting idea, to embed domain specific
language in another.
Does Racket have any support for this?

Leandro Facchinetti  於 2021年1月6日 週三 上午3:20寫道:

> Thanks to everyone who responded (privately and otherwise) for the nice
> words.
>
> Sage Gerard: To each its own. I’m glad to hear that you have these success
> cases with Racket 
>
> --
> 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 visit
> https://groups.google.com/d/msgid/racket-users/ae894452-fb5c-45c1-86f1-f6b228a3c73dn%40googlegroups.com
> 
> .
>


-- 
- sleepnova
呼叫小黃創辦人 & CEO

-- 
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 visit 
https://groups.google.com/d/msgid/racket-users/CABa2-7OuO5KWJ9SCwMBMPv%2BYuB2B74KD2KQJ8wVon2U8FinXMg%40mail.gmail.com.


Re: [racket-users] Tools and Syntax Highlighting

2021-01-06 Thread Ben Ryjikov
Hi Robby and Stephen,

Thanks for your suggestions! It’s working now thanks to a mix of rackunit tools 
and dynamic require.
We’re also thinking about how to make our code less reliant on DrRacket.

Best,
Ben

> On Jan 4, 2021, at 8:11 PM, Robby Findler  wrote:
> 
> I think a good first question here is "what do you want to happen when you 
> are running the program from outside DrRacket?". DrRacket is, in a general 
> sense, designed to reflect extra information about how a program runs when it 
> can glean that information, but it isn't meant to be the only way that Racket 
> programs run, merely one of them. So what you want to think about is: how can 
> a program offer up information about itself (and what APIs/values/data should 
> that be)? and then: how can DrRacket (or other things that run Racket 
> programs, eg Racket Mode, or command-line racket or a standalone executable, 
> etc) get a hold of that information to show it in a meaningful way?
> 
> There are some examples of success following generally this pattern: test 
> coverage is a means whereby a program is expanded, then instrumented by some 
> tool (via rewriting the program) such that the instrumented program produces 
> information about what parts of the program actually ran to its context 
> (which might be DrRacket but might also be the "cover" library). Check Syntax 
> (which runs automatically these days) expands the program and records 
> information about it (notably binding and bound occurrences of variables) and 
> then DrRacket and Emacs Mode let you work with that information. 
> 
> Robby
> 
> 
> 
> On Mon, Jan 4, 2021 at 1:46 PM Ben Ryjikov  > wrote:
> I’m sorry - I didn’t explain what kind of highlighting we’re looking for.
> 
> We’re building a new #lang, and we want it so that sometimes when you run, 
> DrRacket highlights a part of the program you are running. But we only want 
> that in certain situations, so we want to create a function which we can call 
> that would do the highlighting on demand.
> 
> Are there any functions or libraries which can do that?
> 
> We’ve managed to get highlighting through a tool (which is listed in 
> info.rkt), but we’re struggling to get it on demand because we can’t easily 
> find a way for the tool and the program to share code.
> 
> Is there a way for a tool to access code which outside of the tool at runtime?
> 
> -Ben
> 
>> On Jan 4, 2021, at 9:04 AM, Stephen De Gabrielle > > wrote:
>> 
>> On Mon, Jan 4, 2021 at 12:32 AM Ben Ryjikov > > wrote:
>> Hi Racket,
>> 
>> Is it possible for a tool invoked by info.rkt to access code which is 
>> outside of the tool?
>> 
>> We’re building a #lang and would like to have on-demand syntax highlighting.
>> We’ve tried using a tool, and have successfully made a button and a menu 
>> item that do it, but we’d like to activate the highlighting programmatically 
>> at runtime instead of by clicking on something.
>> We also are hoping to have multiple highlights at once if possible.
>> 
>> Is there any way to get on-demand syntax highlighting without using a button 
>> or menu item? Are there any pre-existing Racket tools or functions that 
>> would do this?
>> 
>> I think datalog does this;
>> 
>> 
>> 
>> 
>>  
>> 
>> Thanks for your time and Happy New Year!
>> 
>> Best,
>> Ben
>> 
>> -- 
>> 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 visit 
>> https://groups.google.com/d/msgid/racket-users/BA1B6C4F-8172-462F-9E2D-8F6F2A9C6BB4%40gmail.com
>>  
>> .
> 
> 
> -- 
> 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 visit 
> https://groups.google.com/d/msgid/racket-users/C549A2BB-8999-496B-B119-70239EB13EDB%40gmail.com
>  
> .

-- 
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 visit 
https://groups.google.com/d/msgid/racket-users/420DFA37-A971-403B-AD4B-F4C22B27453E%40gmail.com.