> It apparently doesn't run the defs _at all_. The interactive pane will
> not recognize _any_ of the variables or functions that appear to be
> defined in the definition pane and should form the environment (or scope
> or whatever the correct word) after I click on the "Run" button. And I
> don't
Just one more question, for clarification. Are you using the `lambda` form in
BSL? I ask because several examples in this thread have been using `lambda`,
but I don't think that lambda expressions are actually valid in either of the
beginning student languages, though I would expect you to recei
> Just one more question, for clarification. Are you using the `lambda` form in
> BSL? I ask because several examples in this thread have been using `lambda`,
> but I
> don't think that lambda expressions are actually valid in either of the
> beginning student languages, though I would expect y
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 modules
> 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 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 t
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]:
http://docs.racket-lang.org/reference/sequences.html?q=in-lines#%28def._%2
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
f
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 th
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-
> contracts.html#%28def._%28%28lib._racket%2Fcontract%
> 2Fprivate%2Fmi
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))
#:pro
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 chape
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 as parameters two list
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
(pri
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
assum
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 no
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)
> (sh
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 "edit
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 an
rom github, I'd 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 wrote:
> I've started working on adding this refactor
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 wrote:
> I think I've finally got something working within DrRacket
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 9
The define-signature form allows define-values and define-values-for-export
forms in its body. According to the documentation the define-values form should
prefix any unit that imports the signature, and define-values-for-export should
suffix any unit that exports the signature, but the actual b
I've been implementing a type system with subtyping using Redex's judgment
forms and noticed that checking whether my typing judgment would hold was
taking longer than seemed reasonable (5 - 10 minutes in some cases).
Ultimately I tracked the bug down to a clause in the subtyping judgment that
> I wouldn't expect the type checker to support all working plain Racket
> code. But I do expect Typed Racket to provide equivalent (though
> possibly syntactically different) APIs for common tasks such as
> creating an immutable hash table from key-value pairs.
>
> I suppose the problem with hash
I'm trying to use `module->language-info` to determine if a module I am
requiring is written in typed/racket or racket, since if the module is
implemented in racket `module->language-info` will return #f, but a vector if
the module was typed.
The problem I'm running into is that with files of
Looking at the expansion in the macro stepper of
1.
;; ---
#lang racket/signature
(struct foo (bar))
2.
;; ---
#lang racket
(define-signature foo^ ((struct foo (bar
It looks like in the first case a un
27 matches
Mail list logo