Re: [racket-users] acceptable drracket definitions for interaction

2019-08-19 Thread 'John Clements' via Racket Users
Are you referring to section 6.3, which defines modules as individual 
s-expressions?

It appears to me that this code would work fine if specified in the style shown 
earlier in section 6.1, where each module appears in its own file, begins with 
a #lang declaration, and the one referred to the other one using the name of 
the file in quotes. This would match the most common case of code development, 
where each module is contained in its own file.

However, you can certainly put both of them into one buffer, if that’s actually 
what you want. Use a #lang declaration at the top to implicitly wrap the whole 
file in a single module, making these two submodules, like this:

#lang racket

(module increment racket
(provide increment)
  
; increment : exact-integer? -> exact-integer?
(define (increment x) "this is broken"))

(module client typed/racket
  
(require/typed (submod ".." increment) [increment (-> Integer Integer)])
  
(increment 5))

(require ‘client)

Honestly, though, I would urge you to adopt the two-files style unless you have 
a really compelling reason not to.

John



> On Aug 14, 2019, at 11:47, rick  wrote:
> 
> Hello Racketeers,
> 
> I am brand new to Racket. I am interested in Blame Calculus and Gradual Types.
> 
> Thanks for all the great work.
> 
> I have successfully validated the interaction increment example [1] in 
> DrRacket. However, running the combined modules in the definitions window 
> reports that there can only be one expression in the definitions window.
> 
> How can I load both modules in the definitions window, so I don't have to 
> keep pasting them into REPL?
> 
> Thanks in advance for your help and thanks again for all the great work on 
> Racket.
> 
> 
> 1. https://docs.racket-lang.org/ts-guide/typed-untyped-interaction.html
> 
> -- 
> rick
> 
> -- 
> 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/dfc48fe3-10e9-0461-89e7-51a03a6207e5%40rickmurphy.org.



-- 
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/04d6009f-da88-4b9c-a173-67feef3d9b0e%40mtasv.net.


[racket-users] acceptable drracket definitions for interaction

2019-08-14 Thread rick

Hello Racketeers,

I am brand new to Racket. I am interested in Blame Calculus and Gradual 
Types.


Thanks for all the great work.

I have successfully validated the interaction increment example [1] in 
DrRacket. However, running the combined modules in the definitions 
window reports that there can only be one expression in the definitions 
window.


How can I load both modules in the definitions window, so I don't have 
to keep pasting them into REPL?


Thanks in advance for your help and thanks again for all the great work 
on Racket.



1. https://docs.racket-lang.org/ts-guide/typed-untyped-interaction.html

--
rick

--
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/dfc48fe3-10e9-0461-89e7-51a03a6207e5%40rickmurphy.org.