Hi Matthew,
Thanks for the explanations. But I'm still not convinced that the
top-level-bind-scope is needed. This is my current understanding. The
purpose of the top-level-bind-scope is to support recursion better at the
top level. But for the case of `(define-values (x) ...)`, if `x` is not
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 unde
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 following
> 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.,
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)
>> >
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 th
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 followi
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
> https://docs.racket-lang.org/reference/data-structure-contracts.html?q=parameterof#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._parameter%2Fc%2
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)
>
>
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: to
(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: read
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
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
(contra
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 Ra
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 `...` w
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
https:
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):
; applicatio
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:
> /pfds/pfds/scribblings/
18 matches
Mail list logo