Re: [racket-users] Is there a trick to know which types to specify when importing untyped racket into typed racket?

2019-10-06 Thread Ben Greenman
On 10/6/19, Raoul Schorer  wrote:
> Hi,
>
> I would very much like to import the package multimethod
> 
>
> into a typed module. Unfortunately, the symbols exported by this module are
>
> non-trivial macros (at least to me).
> So I would like to know whether there is some kind of technique to know
> which type to specify for imported symbols with require/typed?
> I tried various things to no avail. Will I be forced to check the code
> expansion and try to check types manually if I want to use the package?

I don't know any alternative to typechecking the expanded code to see
if anything's missing

-- 
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/CAFUu9R780%2B4__%2BjsXjf4ZRYTSHw5v%3DOERDu-JssWB371GoK5gA%40mail.gmail.com.


[racket-users] Is there a trick to know which types to specify when importing untyped racket into typed racket?

2019-10-06 Thread Raoul Schorer
Hi,

I would very much like to import the package multimethod 

 
into a typed module. Unfortunately, the symbols exported by this module are 
non-trivial macros (at least to me).
So I would like to know whether there is some kind of technique to know 
which type to specify for imported symbols with require/typed?
I tried various things to no avail. Will I be forced to check the code 
expansion and try to check types manually if I want to use the package?

So, in practice:
#lang typed/racket


(require/typed multimethod
   [struct ...?]
   [define-generic ...?]
   [define-instance ...?])

Thanks!
Raoul

-- 
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/0376044f-673d-4fcd-8526-82d4196d2570%40googlegroups.com.


[racket-users] Re: My macro works in the global namespace, but fails inside of a let

2019-10-06 Thread gfb
Hmm, maybe you'd find “parameters” (not to be confused with function 
parameters) useful for your goals.

#lang racket

(define current_meaning (make-parameter "some string"))

(define (display_current_meaning)
  (display (current_meaning)))

(display_current_meaning)

(let ()
  (parameterize ([current_meaning "a different string"])
(display_current_meaning)))

(display_current_meaning)

-- 
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/47a28e82-eb5f-418d-8f45-71876c561719%40googlegroups.com.


[racket-users] Re: My macro works in the global namespace, but fails inside of a let

2019-10-06 Thread gfb
No doubt you will soon get more precise answers, and help for your goal, 
from others, but the first step is that macros in scheme and racket are not 
straight textual substitutions.

The a_definition in the template of my_macro has much the same scope as it 
would if my_macro were just a function (defined with define, and then I'd 
refer to (display a_definition) as “the body” rather than “the template”).

-- 
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/f88821df-5cac-40fb-a097-ee94ca25c066%40googlegroups.com.


[racket-users] My macro works in the global namespace, but fails inside of a let

2019-10-06 Thread Cistian Alejandro Alvarado Vázquez
I start with the following code, which works as you'd expect:

#lang racket

(require syntax/parse/define)

(define-simple-macro (my-macro)
  (display a_definition))

(define a_definition "some string")
(my-macro)

(It displays the text "some string")

Then tried defining a_definition and calling the macro again, but inside of 
let:

(require syntax/parse/define)

(define-simple-macro (my-macro)
  (display a_definition))

(let ()
  (define a_definition "some string")
  (my-macro))

This time I get an error:

a_definition: unbound identifier
  context...:
  other binding...:
  common scopes...: in: a_definition

!! This perplexes me, as from my (very limited) understanding, the above 
code should just macrologically expand into something akin to:

(let ()
  (define a_definition "some string")
  (display a_definition))

Which is what appears to be happening when I do the same thing in the 
global space. I really want to be able to define something within a code 
block and have access to that definition via macros called in that same 
code block. What is recommended?

-- 
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/bb0ea585-0fe4-41bb-a639-af13143b61bb%40googlegroups.com.


[racket-users] Re: Package server broken, at least five hundred intro cs students affected!

2019-10-06 Thread gfb
Thank you so much, including for the quick turnaround, on a Sunday no less, 
once you found out!

-- 
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/4f4c-a95b-4dca-80a0-3efa30e6f851%40googlegroups.com.


Re: [racket-users] Re: Package server broken, at least five hundred intro cs students affected!

2019-10-06 Thread Tony Garnock-Jones
On Sunday, October 6, 2019 at 3:26:13 PM UTC+1, Bogdan Popa wrote:
>
> I feel like that was me.  Sorry! 
>

It was :-) No apologies please! There was nothing wrong with your packages; 
it was the package indexer at fault here.

One thing I'd like to do is formalise and then check the contracts that 
describe the information exchanged among the various infrastructure 
services. At the moment it's all very dynamic-typey, not even contracted. 
Introducing machine-checkable descriptions of some of the protocols could 
give us enough leverage to gradually refactor things into better shape.

Regards,
  Tony

-- 
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/19a72344-4700-42eb-ada9-0e6d4aa6df7e%40googlegroups.com.


Re: [racket-users] Re: Package server broken, at least five hundred intro cs students affected!

2019-10-06 Thread Bogdan Popa


> (The issue was that some of the packages had started to take advantage of a
> feature of the dependencies list in info.rkt that allowed regular
> expressions in the platform restriction clause. When it came time for the
> indexer to convert the dependencies list to JSON, it failed because it
> didn't know how to handle regular expressions.)

I feel like that was me.  Sorry!

-- 
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/m2bluu3q80.fsf%40192.168.0.139.


[racket-users] Re: Package server broken, at least five hundred intro cs students affected!

2019-10-06 Thread Tony Garnock-Jones
Hi Gary,

On Saturday, October 5, 2019 at 11:22:30 PM UTC+1, gfb wrote:
>
> 1. What's wrong with the package server's indexing of updated packages, so 
> my students can proceed.
>

Thanks for the report, and sorry for the delay in responding.

I've made a change that ought to resolve the issue that was preventing the 
indexer from running, and restarted the indexer. It should be back up to 
date in the next few minutes.

(The issue was that some of the packages had started to take advantage of a 
feature of the dependencies list in info.rkt that allowed regular 
expressions in the platform restriction clause. When it came time for the 
indexer to convert the dependencies list to JSON, it failed because it 
didn't know how to handle regular expressions.)
 

> 2. An official channel to report problems with the package server.
>

You found it: emailing me and Jay is as good as it gets at the minute, I'm 
afraid. We should collectively maybe figure out something better for 
infrastructural issues!

Regards,
  Tony

-- 
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/6aa5eb73-e62a-4605-a310-ba3112fa198a%40googlegroups.com.


[racket-users] Re: Package server broken, at least five hundred intro cs students affected!

2019-10-06 Thread Jesse Alama
Hi Gary,

On Sunday, October 6, 2019 at 12:22:30 AM UTC+2, gfb wrote:

3. If funding specifically earmarked to support monitoring of and feedback 
> from that channel, fixing of issues, and general reliability work, would 
> help, because I would be happy to contribute some of my professional 
> development funds to that.
>

The core Racket guys can correct me if I'm wrong, but I'd wager that the 
Racket folks would definitely appreciate some $$$, especially to assist 
with devops issues such as sites being down, indexing failing, etc. One way 
to get started would be to set up a recurring donation: 
https://racket-lang.org/sfc.html . I encourage everyone who relies on 
Racket for his work or business to help out in this way.

Jesse

-- 
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/b9d1dc81-072d-468b-b015-a62b144a3059%40googlegroups.com.