[racket] scribble/manual exports racket bindings for-label?

2015-01-26 Thread Alexander D. Knauth
This program: #lang scribble/manual @(require (for-label typed/racket)) Gives me this error: . module: identifier already imported for label from a different source in: for typed/racket typed/racket But this program: #lang scribble/manual @(require (for-label racket)) Runs fine. Does scribbl

Re: [racket] macro pattern problem

2015-01-26 Thread Matthias Felleisen
1. You should make your macro robust and deal with fewer than two elements in your uses. 2. Here is the same idea w/ syntax-rules: #lang racket (define-syntax quote-even (syntax-rules () [(_) '()] [(_ zero) (list 'zero)] [(_ zero one two ...) (list* 'zero one (quote-even two .

Re: [racket] macro pattern problem

2015-01-26 Thread Peter Samarin
Great, thanks! On 01/26/2015 10:57 PM, Alexander D. Knauth wrote: syntax/parse can do that: #lang racket (require (for-syntax racket/base syntax/parse syntax/parse/experimental/template)) (define-syntax quote-even (syntax-parser [(quote-even (~seq att val) ...) (template (list (?@ 'a

Re: [racket] macro pattern problem

2015-01-26 Thread Alexander D. Knauth
syntax/parse can do that: #lang racket (require (for-syntax racket/base syntax/parse syntax/parse/experimental/template)) (define-syntax quote-even (syntax-parser [(quote-even (~seq att val) ...) (template (list (?@ 'att val) ...))])) (quote-even a 1 b 2) ; '(a 1 b 2) On Jan 26, 2015, at

[racket] the type of current-inexact-milliseconds

2015-01-26 Thread Alexander D. Knauth
Does current-inexact-milliseconds always return a positive flonum? Would it ever not return a positive flonum, and if it doesn’t, should the type of it in typed racket be changed? Racket Users list: http://lists.racket-lang.org/users

[racket] macro pattern problem

2015-01-26 Thread Peter Samarin
Hello all, I want to quote every even and evaluate every odd variable of the input and assemble everything in a list. So I wrote the following macro to do it: (define-syntax quote-even (syntax-rules () [(quote-even att val ...) (list 'att val ...)])) But in the resulting list, only

Re: [racket] Scribble: fake section links

2015-01-26 Thread David Van Horn
On 1/26/15 4:24 PM, Matthias Felleisen wrote: > > Try that: > > @(toc-element #f "" (hyperlink "http://www.ccs.neu.edu/home/matthias/"; > "Home")) That's close, but it lists "Home" under "On this page", not the top level section listing. (I didn't even see it on your course page until I loo

Re: [racket] Scribble: fake section links

2015-01-26 Thread Stephen Chang
Ok so something like @section{@hyperlink["http://google.com"]{google}} is insufficient because the side link doesnt go to google? On Mon, Jan 26, 2015 at 4:19 PM, David Van Horn wrote: > On 1/26/15 4:14 PM, Stephen Chang wrote: >>> Is there a way to make @link that appears like a @section heading

Re: [racket] Scribble: fake section links

2015-01-26 Thread Matthias Felleisen
Try that: @(toc-element #f "" (hyperlink "http://www.ccs.neu.edu/home/matthias/"; "Home")) -- Matthias On Jan 26, 2015, at 4:19 PM, David Van Horn wrote: > On 1/26/15 4:14 PM, Stephen Chang wrote: >>> Is there a way to make @link that appears like a @section heading? I >>> want to hav

Re: [racket] Scribble: fake section links

2015-01-26 Thread David Van Horn
On 1/26/15 4:14 PM, Stephen Chang wrote: >> Is there a way to make @link that appears like a @section heading? I >> want to have links to external URLs that appear as though they're >> section headings in a scribble-based web page. > > So you want the link to have the style of a section header bu

Re: [racket] Scribble: fake section links

2015-01-26 Thread Stephen Chang
> Is there a way to make @link that appears like a @section heading? I > want to have links to external URLs that appear as though they're > section headings in a scribble-based web page. So you want the link to have the style of a section header but not actually be registered as a section? > >

[racket] Scribble: fake section links

2015-01-26 Thread David Van Horn
Is there a way to make @link that appears like a @section heading? I want to have links to external URLs that appear as though they're section headings in a scribble-based web page. Thanks! David Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Untyped arithmetics performance

2015-01-26 Thread Sam Tobin-Hochstadt
Thanks, that works great. Looks really cool! Sam On Mon Jan 26 2015 at 2:27:44 PM Xiangqi Li wrote: > Right now Medic doesn't support directly running "med.rkt" to get the > results (has to know the set of medic programs to execute and which source > file to start debugging). We need to write an

Re: [racket] Untyped arithmetics performance

2015-01-26 Thread Xiangqi Li
Right now Medic doesn't support directly running "med.rkt" to get the results (has to know the set of medic programs to execute and which source file to start debugging). We need to write another program to debug the source code. The program should be in the same directory of medic programs: #lang

Re: [racket] Untyped arithmetics performance

2015-01-26 Thread Sam Tobin-Hochstadt
Hi Xiangqui, I just tried to run this, but it didn't show anything. I put this in /tmp/src.rkt: #lang racket (for/fold ([v 0]) ([x (in-range 100)]) (+ v (/ x 100))) (for/fold ([v 0]) ([x (in-range 100)]) (+ v (/ x (- 100 x and this in /tmp/med.rkt: #lang medic (layer layer1

Re: [racket] Untyped arithmetics performance

2015-01-26 Thread Xiangqi Li
For the testing program provided by Matthew, we can also use *(timeline v)* (an enhanced version of displayln) to compare the value of v at each iteration and see the results in a better way: ​If you want to try it out yourself, you can go to https://github.com/lixiangqi/medic and install the Med

Re: [racket] machine states diagrams

2015-01-26 Thread Robby Findler
DrRacket's scrolling is not very friendly to large images in the interactions window. I should really try to fix that. Robby On Mon, Jan 26, 2015 at 5:52 AM, Jens Axel Søgaard wrote: > Turned out the solution was to scroll up. The dimensions of the screen > made it difficult to see. > > /Jens Ax

Re: [racket] machine states diagrams

2015-01-26 Thread Jens Axel Søgaard
Turned out the solution was to scroll up. The dimensions of the screen made it difficult to see. /Jens Axel 2015-01-26 0:42 GMT+01:00 Catonano : > > > 2014-12-02 17:03 GMT+01:00 Jens Axel Søgaard : >> >> Here is an example drawing a simple state machine with MetaPict. >> It shows a little state