[racket] DrRacket as a notebook?

2013-09-06 Thread Stephen De Gabrielle
Hi, I was wondering if anyone uses DrRacket as a 'notebook' like the 'IPython Notebook'[1]? (perhaps using slideshow?) It strikes me as a middle ground between the interactions repl and slideshow. [1] http://ipython.org/notebook.html [2] http://software-carpentry.org/blog/2013/03/using-noteboo

[racket] Racket for teaching in Japan

2013-09-06 Thread Steve Lloyd
Does anyone know of any groups in Japan who are using Racket for teaching e.g. like the 'Bootstrap' programmes in the US? - Steve Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Question on error message

2013-09-06 Thread Alvin Schatte
Hello Carl, I found a location in mras.rkt where I comment out the provide for the map-2 function, the program runs, and when I re-instate it, it fails. The section of code is: ;; map-2 (provide (proc-doc/names map-2 (procedure? list? list? . -> . list?) (pr

Re: [racket] Implementing an generic interface outside of a struct definition

2013-09-06 Thread Konrad Hinsen
Vincent St-Amour writes: > You can use the `#:defaults' clause of `define-generics' for that. The > documentation included in recent snapshots includes examples of its use: > > > http://www.cs.utah.edu/plt/snapshots/current/doc/reference/struct-generics.html > > You can also use it t

Re: [racket] Implementing an generic interface outside of a struct definition

2013-09-06 Thread Asumu Takikawa
On 2013-09-06 15:46:20 +0200, Konrad Hinsen wrote: > The reason for wanting to implement the methods separately is plain > economy: I have five structures that can use a strictly identical > implementation for gen:dict, and I want to write the code only once. You can write the method implementatio

[racket] Generics: implemented methods not inherited?

2013-09-06 Thread Laurent
Is there a way to inherit methods from a parent struct? If I'm not mistaken, it's not what #:defaults and other keywords are for. For example, the following fails: #lang racket (require racket/generic) (define-generics g (foo g) (bar g)) (struct a () #:methods gen:g [(define (foo g) '(fo

Re: [racket] Implementing an generic interface outside of a struct definition

2013-09-06 Thread Konrad Hinsen
Asumu Takikawa writes: > You can write the method implementations as plain function definitions > in some module, e.g., > > (define (my-dict-ref ...) ...) > ... > (provide my-dict-ref ...) > > and then in each structure you can do > > (struct particular-dict (...) > #:met

Re: [racket] unsealed local-definition

2013-09-06 Thread Laurent
Getting worse: the workaround does not even work anymore and I can't use DrRacket anymore... It does work correctly from command line racket though. On Fri, Sep 6, 2013 at 5:14 PM, Laurent wrote: > Hi, > > In DrRacket, I keep getting the following error on some files that are > part of a devel

Re: [racket] unsealed local-definition

2013-09-06 Thread Robby Findler
Does it help to disable drracket's online compilation (in the language dialog)? Robby On Friday, September 6, 2013, Laurent wrote: > Getting worse: the workaround does not even work anymore and I can't use > DrRacket anymore... > It does work correctly from command line racket though. > > > > On

Re: [racket] unsealed local-definition

2013-09-06 Thread Laurent
It does indeed! FWIW, I also get more and more the following popup error: car: contract violation expected: pair? given: '#hash() context...: /home/orseau/build/racket/racket/collects/racket/private/serialize.rkt:639:2: deserialize /home/orseau/build/racket/pkgs/drracket-pkgs/drracket/drra

Re: [racket] unsealed local-definition

2013-09-06 Thread Laurent
On Fri, Sep 6, 2013 at 5:56 PM, Matthew Flatt wrote: > Does `raco make` report the same error? > No, it does not. > I don't suppose that you have any calls to > `syntax-local-make-internal-definition-context` in your code? > You suppose well. > > At Fri, 6 Sep 2013 17:14:28 +0200, Laurent w

Re: [racket] Macro design question: best way to interpret an expression multiple ways

2013-09-06 Thread Neil Toronto
Interesting! I'm already using syntax classes and attributes to factor interpreting primitive functions out of the main `interp' macro, too... I realized yesterday that I don't necessarily want the code to always expand to uses of `&&&' and `>>>'. There may be other interpretations I want to d

[racket] Canadian Racketeers

2013-09-06 Thread Scott Klarenbach
Just wondering about a meetup for any interested Racketeers that are in the Vancouver and/or Toronto area. Our company is based in Vancouver but we do a lot of travel to Toronto, so I thought I'd put out some feelers to see what the landscape looks like up here :). Thanks. -- Talk to you soon,

Re: [racket] Typed racket with serializable struct

2013-09-06 Thread Sam Tobin-Hochstadt
You've stumbled upon two different bugs here. 1. Submodules and Typed Racket interact badly -- this is a bug in the internals of Racket, but won't be fixed in the near future. The workaround, as you discovered, is to use a separate files. 2. `struct-out` and `struct:` interact badly. This is a b

Re: [racket] unsealed local-definition

2013-09-06 Thread Matthew Flatt
Does `raco make` report the same error? I don't suppose that you have any calls to `syntax-local-make-internal-definition-context` in your code? At Fri, 6 Sep 2013 17:14:28 +0200, Laurent wrote: > Hi, > > In DrRacket, I keep getting the following error on some files that are part > of a developm

Re: [racket] Immutable vectors

2013-09-06 Thread Vincent St-Amour
At Thu, 05 Sep 2013 09:01:58 -0600, Neil Toronto wrote: > The best advice I have is to keep performance-critical loops either all > typed or all untyped, unless the only things that cross the contract > boundary are flat first-order datums like flonums, strings and > vectors. (The math library's fl

Re: [racket] Generics: implemented methods not inherited?

2013-09-06 Thread Laurent
Good to know. I'll just be patient then! On Fri, Sep 6, 2013 at 4:54 PM, Asumu Takikawa wrote: > On 2013-09-06 16:38:56 +0200, Laurent wrote: > >Is there a way to inherit methods from a parent struct? > >If I'm not mistaken, it's not what #:defaults and other keywords are > for. > > Thi

Re: [racket] Generics: implemented methods not inherited?

2013-09-06 Thread Asumu Takikawa
On 2013-09-06 16:38:56 +0200, Laurent wrote: >Is there a way to inherit methods from a parent struct? >If I'm not mistaken, it's not what #:defaults and other keywords are for. This is currently not possible, which is a bug/limitation of generic interfaces and not a design feature. The is

Re: [racket] Canadian Racketeers

2013-09-06 Thread Scott Klarenbach
Yes, tongue firmly planted in cheek. On Fri, Sep 6, 2013 at 2:19 PM, Robby Findler wrote: > Hey, we're all friends here (which is a separate question from the number > of Gods, I suppose :). Marc has done same amazing stuff with Gambit & co! > > Robby > > > On Fri, Sep 6, 2013 at 4:11 PM, Scott

Re: [racket] unsealed local-definition

2013-09-06 Thread Laurent
On Fri, Sep 6, 2013 at 7:05 PM, Robby Findler wrote: > I've pushed a change that should swallow those errors. > Thanks. I won't be able to test before Monday. > They are likely coming about because of an incomplete build, I guess. > Somehow the blueboxes files (which are built as part of the do

[racket] Typed racket with serializable struct

2013-09-06 Thread antoine
Hello, I would like to use a 'serialize-struct' in typed/racket. It seems there is no 'serialize-struct:' built in typed/racket. So i have decided to put the struct into a specific submodule and require/type the structs. ;;test.rkt #lang typed/racket (module data-structs racket

Re: [racket] Canadian Racketeers

2013-09-06 Thread Robby Findler
Hey, we're all friends here (which is a separate question from the number of Gods, I suppose :). Marc has done same amazing stuff with Gambit & co! Robby On Fri, Sep 6, 2013 at 4:11 PM, Scott Klarenbach wrote: > Thanks Marc. Let me add that Schemers and Lispers are welcome and will > suffice

[racket] unsealed local-definition

2013-09-06 Thread Laurent
Hi, In DrRacket, I keep getting the following error on some files that are part of a development package: ../../../../../build/racket/racket/collects/compiler/cm.rkt:430:6: write: unsealed local-definition or module context found in syntax object This prevents the compilation of the rkt files. T

Re: [racket] Question on error message

2013-09-06 Thread Carl Eastlund
Alvin, This looks like a bug in errortrace, one of the compiler extensions DrRacket uses to provide debugging information at runtime. Here's a workaround you can use: 1. Open the "Language" menu. 2. If there is no right-hand pane to the menu, click the "Show Details" button in the lower left

Re: [racket] unsealed local-definition

2013-09-06 Thread Robby Findler
I've pushed a change that should swallow those errors. They are likely coming about because of an incomplete build, I guess. Somehow the blueboxes files (which are built as part of the docs build) appear to have been corrupted. Robby On Fri, Sep 6, 2013 at 10:42 AM, Laurent wrote: > It does i

Re: [racket] Canadian Racketeers

2013-09-06 Thread Scott Klarenbach
Thanks Marc. Let me add that Schemers and Lispers are welcome and will suffice in lieu of those that have already been converted to the one true God. :) sk On Fri, Sep 6, 2013 at 12:58 PM, Marc Feeley wrote: > Not in Vancouver or Toronto, and not for Racket, but if you come to > Montreal I'll

Re: [racket] Introductory talk on Contracts and Functional Contracts, with most examples in Racket

2013-09-06 Thread Daniel Prager
My talk went down well and the audience of mainly Clojurists and Haskellers were engaged and few people were keen to go away and have a play. One participant reddited the slides and they've been downloaded almost 2000 times so far. The top comment on reddit included a piece of Haskell advocacy (s

Re: [racket] Introductory talk on Contracts and Functional Contracts, with most examples in Racket

2013-09-06 Thread Robby Findler
Glad to hear it! As for the quickcheck/contracts interaction, Racket has some (not completely polished) support for exactly that; it works by randomly generating inputs based on the contracts and trying to get blame to fall on the tested function. Robby On Fri, Sep 6, 2013 at 5:01 PM, Daniel P

Re: [racket] Combining iteration and match

2013-09-06 Thread Stephen Chang
> The 2-3x estimate was for runtime, in the case of for loops with many > iterations (ie millions). I've just pushed some optimizations though > that cut the slowdown to maybe 1.5-2x, in preliminary experiments. So > you should "pkg update" (or pull if you are using the source directly) > to get th

[racket] a problem with image.rkt teachpack

2013-09-06 Thread Elena Machkasova
Good evening, this may've come up before, but I looked through the last few messages and did a bit of searching, and couldn't find anything about this problem. My apologies if this is already a known issue. When DrRacket is installed, it comes with 3 pre-installed teachpacks, including image

Re: [racket] a problem with image.rkt teachpack

2013-09-06 Thread Robby Findler
Unfortunately, this is the way things work. Those are actually two different teachpacks and the error message that you are getting is a poorly worded "these two teachpacks conflict with each other". Is there perhaps some other behavior you'd prefer? And, I should also point that even if we do fin

Re: [racket] a problem with image.rkt teachpack

2013-09-06 Thread Marco Morazan
Hi Elena, You can also remove the teachpack from column one. It is, however, simple enough for students to only add the teachpack in column 2. Once you add a teachpack, it remains added until it is removed. My first year students run DrRacket without removing the teachpack all semester. Marco O