Re: [racket] Why isn't at-exp the default?

2013-11-16 Thread Matthew Flatt
Although the `#lang` mechanism doesn't have a built-in mechanism for options, a particular language can support them. For example, you might define `pollen` so that #lang pollen [char] sets the command character when [char] appears after `pollen` and exactly one space. The `scribble/sigplan` la

Re: [racket] Why isn't at-exp the default?

2013-11-16 Thread Matthew Butterick
Somewhat relatedly, have you ever considered making it possible for #lang languages to expose configuration parameters in the #lang line? For instance, at-expressions can be marked with any unicode character. To use this functionality, however, one needs to set up a baby #lang that uses make-at

Re: [racket] Interpretation of font information

2013-11-16 Thread Matthew Flatt
At Fri, 15 Nov 2013 23:03:21 +0100, Jens Axel Søgaard wrote: > Anyways, since pict-height didn't return the correct height, I tried: > (send (dc-for-text-size) get-text-extent "√" font)) > but I am not able to make sense of the results. For most fonts > I get a height of 30, but others give the

Re: [racket] Separate files in the HtDP languages?

2013-11-16 Thread Matthew Flatt
At Sat, 16 Nov 2013 12:44:03 -0500, Norman Ramsey wrote: > On their next assignment, my students will reuse code they have > built for binary search trees. I would prefer that they place the > old code in a different source file than the new code. I tried > doing this using "require", but I canno

Re: [racket] Why isn't at-exp the default?

2013-11-16 Thread Matthew Flatt
Back when we introduced `#lang racket`, we could have included @-notation by default, but I think we were focused on making `#lang racket` a small shift from `#lang scheme`. And `#lang scheme` was too long ago. Backward compatibility rules out adding @-notation to `#lang racket`, but I agree that

Re: [racket] How to compile C libraries that use Cairo?

2013-11-16 Thread Matthew Flatt
At Sat, 16 Nov 2013 22:16:40 +0100, Jens Axel Søgaard wrote: > Welcome to DrRacket, version 5.90.0.10--2013-11-10(53c6658e/d) [3m]. > Language: racket/gui. > . . ffi-lib: couldn't open "librsvg-2.2.dylib" > (dlopen(librsvg-2.2.dylib, 6): Library not loaded: > /opt/local/lib/libcairo.2.dylib > Ref

Re: [racket] serializability of ISL structures?

2013-11-16 Thread Norman Ramsey
> > [Are ISL structures made with define-struct serializable?] > > Kind of. If this is about Universe programming (so that students can send > messages back and forth), I have them write conversion functions: > > (define-struct hh (cakes henries)) > > (define (hh->lists hh) >(list

[racket] How to compile C libraries that use Cairo?

2013-11-16 Thread Jens Axel Søgaard
Hi All, I spent the day trying to get Asumu's bindings to librsvg (a library that renders svg-files via Cairo) to run on OS X. The problem seems to be the same that made me give up getting libpoppler to work on OS X, so I was willing to use some time on it. The library works on Linux, but it cra

Re: [racket] An elm-like racket language?

2013-11-16 Thread Daniel Prager
I wrote: > How might I get the color to change not just when the user selects > (mouse-ups), but also as a kind of live preview? > Greg replied: > The underlying choice% control doesn't appear to expose a "hover" event, so I don't think there's any way to get what > you're describing, even in raw

Re: [racket] An elm-like racket language?

2013-11-16 Thread Gregory Cooper
On Fri, Nov 15, 2013 at 3:14 PM, Daniel Prager wrote: > My current (learning) scenario is to slap a simple GUI onto a specialised > image editor that I have been working on. > > At the moment it feels like the way to learn FrTime is by reading and > adapting the examples and diving into the source

Re: [racket] serializability of ISL structures?

2013-11-16 Thread Marco Morazan
I agree. Having the students write the marshalling and unmarshalling functions is important when introducing them to DP. It also a great way to demonstrate the importance inverse functions. Take a look at some of my thoughts here: http://faculty.cs.byu.edu/~jay/conferences/2013-tfp/proceedings/tfp2

Re: [racket] serializability of ISL structures?

2013-11-16 Thread Matthias Felleisen
I have considered making them prefab instead Sent from my iPhone > On Nov 16, 2013, at 12:32 PM, Jay McCarthy wrote: > > I think the conversion function is useful pedagogically to talk about > the need to serialize, but having it just work might be expedient in > other situations. I do not be

[racket] Separate files in the HtDP languages?

2013-11-16 Thread Norman Ramsey
On their next assignment, my students will reuse code they have built for binary search trees. I would prefer that they place the old code in a different source file than the new code. I tried doing this using "require", but I cannot figure out how to get "require" to load a file that is written

Re: [racket] serializability of ISL structures?

2013-11-16 Thread Jay McCarthy
I think the conversion function is useful pedagogically to talk about the need to serialize, but having it just work might be expedient in other situations. I do not believe that they are actually serializable, but we could fairly easily make that change. On Sat, Nov 16, 2013 at 10:22 AM, Matthias

Re: [racket] serializability of ISL structures?

2013-11-16 Thread Matthias Felleisen
Kind of. If this is about Universe programming (so that students can send messages back and forth), I have them write conversion functions: (define-struct hh (cakes henries)) (define (hh->lists hh) (list (cakes->lists (hh-cakes hh)) (henries->lists (hh-henries hh -- Matthias On N

[racket] serializability of ISL structures?

2013-11-16 Thread Norman Ramsey
A structure is defined with `define-struct` in Intermediate Student Language. Is it serializable? That is, can it be written and then re-read successfully with `write` and `read`? If not, is there a way to make it so? (I have found the function `make-serialize-info` in the racket/serialize libra

Re: [racket] Best way to propose changes to Scribble CSS files

2013-11-16 Thread Matthew Butterick
It's a reasonable suggestion. I've updated the design so that all the internal cross-references share the same color. http://mbutterick.github.io/racket-doc-redo/doc/ On Nov 15, 2013, at 7:25 AM, Neil Toronto wrote: > On 11/13/2013 11:33 PM, David T. Pierson wrote: >> On Wed, Nov 13, 2013

Re: [racket] An elm-like racket language?

2013-11-16 Thread Anthony Carrico
On 11/16/2013 08:57 AM, Anthony Carrico wrote: > 6. Here is an example from my unit tests. It is a delay line: Oops, I forgot to show you the output: $ raco test main.rkt raco test: (submod "main.rkt" test) ::: (1 0 0 1) ::: (3 0 1 2) ::: (6 1 2 3) ::: (9 2 3 4) 12 tests passed -- Anthony Carr

Re: [racket] An elm-like racket language?

2013-11-16 Thread Anthony Carrico
On 11/12/2013 03:21 PM, Daniel Prager wrote: > Given the existence of FrTime, whalesong, and FlapJax is anyone > working on or considering doing an elm-like language > (http://elm-lang.org/) for Racket? I've taken a look at FrTime, FlapJax, and Elm. I agree that it is all a good idea. It appeals t