If the issue you're facing is mutual dependencies between modules, then using
units[1] is one possible solution.
Units are first-class modules that allow cyclic linking, and would avoid the
need to use include. In particular using #lang racket/unit [2] may be useful to
convert each the
> I just never found any good docs on how to do that. Near as I can tell,
runtime linking of a unit is even MORE verbose and persnickety than just
> manually typing in all the procedures you want to pass to a callback
Some of the verbosity of units can be reduced using the "inference"
features
> and then get Paul's version:
>
> cd redex
> git remote add paul https://github.com/paulstansifer/redex-1.git
> git checkout public
> raco setup
This didn't quite work for me the first time I tried it, I needed to run
`git fetch paul` before the checkout to make it work.
Looking forward
I think the issue is that `read-line` is returning a string, so in every
iteration of the for loop line is bound to a single character from that
string, I think you may want to use `in-lines`[1] instead of `read-line`.
[1]:
This doesn't quite answer your question, but another possibility that would
allow you to separate the a@ and b@ unit implementations in separate files
is to put all of your signature definitions in a single file that will be
required by both "a.rkt" and "b.rkt". In my experience, this strategy is
Can you give a little more context?
I tried running your program in DrRacket and it seems to work, or at least
I don't get the error you're seeing.
Dan
On Tue, Apr 26, 2016 at 7:39 PM, Andreas Petrou wrote:
> My code is here:)
> ;3.) A function called allDiff? that takes
When you write
(mixin (drracket:unit:frame<%>) (drracket:unit:tab<%>)
;; body
...)
This produces a function that takes classes which implement the
drracket:unit:frame<%> interface and produces classes that implement the
drracket:unit:tab<%> interface. In the body of the mixin you can only
If you want to inherit from both the frame and the tab in the mixin you
would write something like:
(mixin
(drracket:unit:frame<%>
drracket:unit:tab<%>)
()
;; body
...)
In this case the mixin will only work on classes that implement both the
tab and the frame interfaces, and you can
Here's a version that uses a #:pre condition:
#lang racket
(define/contract (tau l m)
(->i ([list1 (listof (and/c exact-integer? (>/c 0)))]
[list2 (listof (and/c exact-integer? (>/c 0)))])
#:pre (list1 list2) (= (length list1) (length list2))
[_ number?])
(begin
I think something like this works:
;; shuffle/seed : list? integer -> list?
(define (shuffle/seed lst seed)
(random-seed seed)
(shuffle lst))
> (define a-list (list 1 2 3 4 5 6 7 8 9 10))
> (shuffle/seed a-list 0)
'(3 4 9 8 5 1 10 7 6 2)
> (shuffle/seed a-list 0)
'(3 4 9 8 5 1 10 7 6 2)
>
For those not tracking the DrRacket github repo, this feature is now
available in the Racket snapshot builds.
https://plt.eecs.northwestern.edu/snapshots/
Thanks,
Dan
On Wed, Mar 22, 2017 at 5:17 PM, Daniel Feltey <dfel...@ccs.neu.edu> wrote:
> I think I've finally got something worki
appreciate any feedback you might
on the tool or how it could be improved.
[1]:
https://github.com/racket/drracket/commit/10ac8e7d91c4d7ae7ba2dc6d929a7ec7ed9fe186
Thanks
Dan
On Mon, Mar 13, 2017 at 9:43 PM, Daniel Feltey <dfel...@ccs.neu.edu> wrote:
> I've started working on adding this re
I think the intention of the docs is that `drracket:rep:text<%>` is the
interface for all of the methods listed under the `drracket:rep:text%`
class. It looks like at the very least it extends the `racket:text<%>`
interface, this is likely just an oversight in the documentation.
Dan
On Sun, Apr
The easiest way to do this is to use the text:line-numbers-mixin in the
framework. Here's an example of an editor with line numbers:
#lang racket
(require racket/gui framework)
(define text (new (text:line-numbers-mixin text:standard-style-list%)))
(define frame
(new frame%
[label
I've started working on adding this refactoring to DrRacket[1], it's not
quite as full-featured(and is definitely still a bit buggy) as what
racket-mode in emacs seems to allow, but it's a first step and I'd
appreciate suggestions or requests on how DrRacket can better support
developers editing
Sorry for the late reply to this thread, I tried to send this message
yesterday, but ran into problems with my email setup.
> I'm starting to think that my base assumption (that Typed Units are more
or
> less equivalent to ML signatures, structures, and functors) is way off.
The intent is that
Are you using a recent version of Racket? I see the same error in Racket
6.8, but not in more recent releases.
Dan
On Fri, Jan 5, 2018 at 2:15 PM, David Storrs wrote:
> https://docs.racket-lang.org/reference/data-structure-
>
I'm trying to understand the use of the prop:impersonator-of struct
property, but the following program doesn't work the way I would have
expected:
#lang racket
(struct our-impersonate-proc (f orig)
#:property prop:impersonator-of (lambda (x) (displayln 'hi)
(our-impersonate-proc-orig x))
The same behavior occurs with vectors, the program
(define v (vector 1 2))
(define/contract vc (vectorof integer?) (vector 1 2))
(place-message-allowed? v)
(place-message-allowed? vc)
Produces:
#t
#f
I think the issue here is that both contracted vectors and structs are
wrapped in
19 matches
Mail list logo