Re: [racket-users] Re: questions about top-level-bind-scope in root-expand-context

2020-03-23 Thread Yongming Shen
Oops, I'm afraid things are getting off topic. Just to clarify, my question is really as the title states, about top-level-bind-scope, which is used by the expander to achieve certain effects when expanding define-values/define-syntaxes forms at the top level. I'm mainly trying to get a better

Re: [racket-users] Re: questions about top-level-bind-scope in root-expand-context

2020-03-23 Thread Hendrik Boom
On Mon, Mar 23, 2020 at 05:55:14PM -0400, George Neuner wrote: > On Mon, 23 Mar 2020 16:57:26 -0400, Hendrik Boom > wrote: > > >On Mon, Mar 23, 2020 at 02:46:53PM -0400, George Neuner wrote: > >> On Mon, 23 Mar 2020 01:45:40 -0700 (PDT), Yongming Shen > >> wrote: > >> > >> >I have the

Re: [racket-users] questions about top-level-bind-scope in root-expand-context

2020-03-23 Thread Alexis King
> On Mar 23, 2020, at 13:46, George Neuner wrote: > > I've run into this problem before ... I don't recall the official > explanation, but my takeaway was that Racket does not permit you to > directly *export* a value - you have to export a function or macro > that produces the value. > > E.g.,

[racket-users] Re: questions about top-level-bind-scope in root-expand-context

2020-03-23 Thread George Neuner
On Mon, 23 Mar 2020 16:57:26 -0400, Hendrik Boom wrote: >On Mon, Mar 23, 2020 at 02:46:53PM -0400, George Neuner wrote: >> On Mon, 23 Mar 2020 01:45:40 -0700 (PDT), Yongming Shen >> wrote: >> >> >I have the following as `module-that-defines-fib`: >> > >> > #lang racket >> > (provide fib) >>

Re: [racket-users] Gradual Typed Racket?

2020-03-23 Thread Hendrik Boom
On Mon, Mar 23, 2020 at 12:16:45PM -0400, Ben Greenman wrote: > > Not sure about best practices, but I definitely prefer keeping typed > and untyped code in separate modules. It can be veru useful to be able to mix them while in transition from one to the other. -- hendrik -- You received

Re: [racket-users] Re: questions about top-level-bind-scope in root-expand-context

2020-03-23 Thread Hendrik Boom
On Mon, Mar 23, 2020 at 02:46:53PM -0400, George Neuner wrote: > On Mon, 23 Mar 2020 01:45:40 -0700 (PDT), Yongming Shen > wrote: > > >Hi Matthew, > > > >Thank you for the quick reply! > > > >I tried the example you gave for my first question and it resulted in an > >error. > >I have the

Re: [racket-users] Contracts on parameters

2020-03-23 Thread David Storrs
Thanks, that was exactly it. On Mon, Mar 23, 2020 at 3:51 PM Michael MacLeod wrote: > > I think you are looking for parameter/c. See >

Re: [racket-users] Contracts on parameters

2020-03-23 Thread Eric Griffis
AFK, but it looks like the contract and function on your define/contract are swapped. Maybe the contract check on the one-arg call sets the parameter and then hilarity ensues? Eric On Mon, Mar 23, 2020, 12:36 PM David Storrs wrote: > (define/contract (foo x) > (-> boolean? any) > 'ok) > >

Re: [racket-users] Contracts on parameters

2020-03-23 Thread Ben Greenman
On 3/23/20, David Storrs wrote: > (define/contract (foo x) > (-> boolean? any) > 'ok) > > (foo #t) > 'ok > (foo 7) > ; foo: contract violation > ; expected: boolean? > ; given: 7 > ; in: the 1st argument of > ; (-> boolean? any) > ; contract from: (function foo) > ; blaming:

[racket-users] Contracts on parameters

2020-03-23 Thread David Storrs
(define/contract (foo x) (-> boolean? any) 'ok) (foo #t) 'ok (foo 7) ; foo: contract violation ; expected: boolean? ; given: 7 ; in: the 1st argument of ; (-> boolean? any) ; contract from: (function foo) ; blaming: top-level ;(assuming the contract is correct) ; at:

[racket-users] Re: questions about top-level-bind-scope in root-expand-context

2020-03-23 Thread George Neuner
On Mon, 23 Mar 2020 01:45:40 -0700 (PDT), Yongming Shen wrote: >Hi Matthew, > >Thank you for the quick reply! > >I tried the example you gave for my first question and it resulted in an >error. >I have the following as `module-that-defines-fib`: > > #lang racket > (provide fib) > (define fib

Re: [racket-users] Gradual Typed Racket?

2020-03-23 Thread unlimitedscolobb
Hi Ben, Thank you for your answer! I'll give (sub)modules a try. The examples from the plot library are very helpful, I'll peruse them attentively. I didn't realise that (provide (contract-out)) gave better error messages than define/contract. I'm glad to have chosen to use (provide

Re: [racket-users] Gradual Typed Racket?

2020-03-23 Thread Ben Greenman
On 3/21/20, unlimitedscolobb wrote: > Hello, > > I come to Racket from Haskell and so far I am quite happy, as I feel freer > to do some weird stuff from time to time, and I am absolutely in love with > the Lisp-parens syntax. > > As a former Haskeller, one of the first things I tried was Typed

Re: [racket-users] questions about top-level-bind-scope in root-expand-context

2020-03-23 Thread Matthew Flatt
At Mon, 23 Mar 2020 01:45:40 -0700 (PDT), Yongming Shen wrote: > I tried the example you gave for my first question and it resulted in an > error. Oops --- you're right. I lost track of what we try to make work at the top level. > I think this is because `(define-values (x) ...)` expands `...`

[racket-users] Just had a student ask me to do their work

2020-03-23 Thread Stephen De Gabrielle
On Discord. -- -- 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

Re: [racket-users] questions about top-level-bind-scope in root-expand-context

2020-03-23 Thread Yongming Shen
Hi Matthew, Thank you for the quick reply! I tried the example you gave for my first question and it resulted in an error. I have the following as `module-that-defines-fib`: #lang racket (provide fib) (define fib "fib") And this is the error that I got (using Racket 7.6): ;

Re: [racket-users] FYI, build from HEAD fails in realloc()

2020-03-23 Thread Paulo Matos
Hi John, Has anyone already looked into this? I haven't seen this problem yet. If it's not solved, can you please open an issue? Thanks, Paulo Matos 'John Clements' via Racket Users writes: > Bang! I was wrong. Here’s another similar trace: > > raco setup: 6 running: >