[racket] Advice on using math/array and math/matrix to rewrite MATLAB code

2014-05-02 Thread Daniel Prager
I'm having a go at converting a pitch detection algorithmfrom MATLAB to Typed Racket, and which I'll Open Source if I can get it working, and am after a few pointers, since I'm new to TR and am finding it slow going. Examples of the kind of

Re: [racket] DrRacket package suggestions

2014-05-02 Thread Asumu Takikawa
On 2014-05-02 16:53:31 -0500, Robby Findler wrote: > I'm not sure either, but it is the exn:missing-module? and > exn:missing-module-accessor functions that are supposed to be > conveying the information. So trying to find a program that should > work with those functions (but doesn't) is probably

Re: [racket] typed racket and interfaces

2014-05-02 Thread Asumu Takikawa
On 2014-05-02 18:57:52 +0200, Konrad Hinsen wrote: > Interfaces provide functions that dispatch on the type of one of their > arguments. I don't see how that can be done with types. Maybe we are talking about different things. Interfaces[1] for classes just provide a mechanism for ensuring certain

Re: [racket] typed racket and interfaces

2014-05-02 Thread Asumu Takikawa
On 2014-05-02 21:36:07 -0400, Alexander D. Knauth wrote: >And it gave me this error: >. Type Checker: not a valid type: #:implements in: #:implements This example works for me. I forgot to ask though: are you trying to run this on Racket v6.0? Typed Racket prior to the current pre-release

[racket] DrRacket v6.0.1.6 quits after initial loading window

2014-05-02 Thread Alexander D. Knauth
I tried installing the snapshot build for DrRacket and it just quits after showing the initial loading window. I tried reinstalling and it didn’t help. I don’t know what else to do. Racket Users list: http://lists.racket-lang.org/users

Re: [racket] typed racket and interfaces

2014-05-02 Thread Alexander D. Knauth
On May 2, 2014, at 9:24 PM, dfel...@ccs.neu.edu wrote: > #:implements should be used inside of a Class type form. > > The following is an example from the documentation: > >> (define-type Point<%> (Class (field [x Real] [y Real]))) >> (: colored-point% (Class #:implements Point<%> >

Re: [racket] typed racket and interfaces

2014-05-02 Thread dfeltey
There is some documentation in the pre-release docs at http://www.cs.utah.edu/plt/snapshots/current/doc/ts-reference/Typed_Classes.html?q=Class #:implements should be used inside of a Class type form. The following is an example from the documentation: > (define-type Point<%> (Class (field [x

Re: [racket] typed racket and interfaces

2014-05-02 Thread Alexander D. Knauth
On May 1, 2014, at 11:49 PM, Asumu Takikawa wrote: > On 2014-05-01 22:53:49 -0400, Alexander D. Knauth wrote: >> Is there a way to specify inheritance in a class or interface type >> constructor (so then you can avoid some copying and pasting)? > > IIUC, your question is basically "why does #:i

Re: [racket] gc crash on raspbian

2014-05-02 Thread Matthew Flatt
Version 5.2.1 seems like a long time ago (only two years? really?), and some GC bugs have been fixed since then. Is upgrading to v6.0 possible? We're offering a free ARM JIT with every upgrade! While 7 would be surprisingly close to a valid value for a random `int`, it turns out that the object he

Re: [racket] DrRacket package suggestions

2014-05-02 Thread Robby Findler
I'm not sure either, but it is the exn:missing-module? and exn:missing-module-accessor functions that are supposed to be conveying the information. So trying to find a program that should work with those functions (but doesn't) is probably the place to start. Robby On Fri, May 2, 2014 at 4:50 PM,

Re: [racket] Fwd: read-xml: lex-error when reading Javascript

2014-05-02 Thread Raoul Duke
or run it all through a proxy ;-) https://www.google.com/search?q=convert+html+to+xhtml Racket Users list: http://lists.racket-lang.org/users

[racket] DrRacket package suggestions

2014-05-02 Thread Asumu Takikawa
Hi all, I seem to recall that a while ago DrRacket started to suggest packages to install when you had `require`s that failed to load any modules, but I can't seem to figure out how to trigger this anymore. Was this disabled at some point? I see that the code from this commit: https://github.co

Re: [racket] gc crash on raspbian

2014-05-02 Thread David Griffiths
Hi Matthew, Sorry, I was a bit short on details, I'm running 5.2.1, also using sqlite via jaymccarthy/sqlite:5:1/sqlite on planet. I had assumed it would be some kind of memory corruption, but "7" looks a bit more specific than I'd expect for that (like some kind of specific error value as it's o

Re: [racket] Fwd: read-xml: lex-error when reading Javascript

2014-05-02 Thread Neil Van Dyke
Alegria Baquero wrote at 04/25/2014 04:01 PM: It turns out it believes the operator '<' is an opening xml tag. You're using an XML parser, but HTML is not necessarily XML. You could try to get the file past the XML parser by wrapping the JavaScript parts as per "http://en.wikipedia.org/wiki

Re: [racket] raco distribute produces non-portable folder

2014-05-02 Thread Matthew Flatt
I think we've fixed this problem for the upcoming release (commit 6cb6f3fbf1). Unfortunately, I don't think we came up with a good workaround for v6.0, but you could try a snapshot from ones of the sites at http://pre.racket-lang.org/ At Sat, 19 Apr 2014 22:39:44 -0400, Eric Dong wrote: > I r

Re: [racket] Macros baffle me

2014-05-02 Thread Daniel Prager
Artyom, the Haskell programmer who's documenting his experiences learning Racket now has a second instalment, mainly about macros: http://artyom.me/learning-racket-2. I can't comment authoritatively on the content -- because of my current own level of macro bafflement -- but it reads as a good illu

Re: [racket] Error Message

2014-05-02 Thread Asumu Takikawa
On 2014-04-30 16:07:18 -0700, Kambey Kwame Akari wrote: >Whenever, I try to create a Gui I keep getting "read: illegal use of open >square bracket* for the following code: What language setting are you using? You probably want to use `#lang racket`. Cheers, Asumu Ra

Re: [racket] procedure to string

2014-05-02 Thread Alegria Baquero
Thank you! I will try that. Sorry for the delayed response. Got caught up in another project. On Sat, Jan 4, 2014 at 9:40 AM, Gustavo Massaccesi wrote: > There are more complex closures, that share an external variable. For > example: > ;- > #lang racket > (define-values (up! down!) > (let

[racket] Single Step evaluation in Racket

2014-05-02 Thread Zee Ken
Hi. I just wanted to know the short-cut to do the *single step evaluation* in racket. I want to know if there is anything analogous to adding *watches* in *Turbo C* for particular variable (to see how they change) and then hit *F7* key to implement line by line execution. Is there a way to do th

[racket] Fwd: read-xml: lex-error when reading Javascript

2014-05-02 Thread Alegria Baquero
Hello, I am using the web-server/servlet library to deploy an html: (let ((start (lambda (req) (response/xexpr (string->xexpr (include-template "ui/page.html")) Page.html includes Javascript code and everything works well until I try to use a comparison op

[racket] raco distribute produces non-portable folder

2014-05-02 Thread Eric Dong
I ran raco distribute on a 64-bit Windows running 32-bit Racket 6.0, then moved the resulting folder to another machine. But suddenly this error appears in the console windows and the program refuses to run: file-exists?: contract violation expected: path-string? given: #f context...:

[racket] read-xml: lex-error when reading Javascript

2014-05-02 Thread Alegria Baquero
Hello, I am using the web-server/servlet library to deploy an html: (let ((start (lambda (req) (response/xexpr (string->xexpr (include-template "ui/page.html")) Page.html includes Javascript code and everything works well until I try to use a comparison op

[racket] Error Message

2014-05-02 Thread Kambey Kwame Akari
Hello, Whenever, I try to create a Gui I keep getting "read: illegal use of open square bracket” for the following code: ; Make a frame by instantiating the frame% class (define frame (new frame% [label "Example"])) ; Show the frame by calling its show method (send frame show #t) I am usin

Re: [racket] gc crash on raspbian

2014-05-02 Thread Matthew Flatt
That means something has gone generally wrong with memory management. Do you have a way to replicate the crash? I tried simply running the web server, but I imagine there's a little more to it. At Fri, 02 May 2014 14:09:01 +0100, David Griffiths wrote: > Hi all, > > I'm running a racket web serv

Re: [racket] typed racket and interfaces

2014-05-02 Thread Konrad Hinsen
Asumu Takikawa writes: > There is not (yet) and I don't know how we will support it if we do. > Right now the only option is to remove interfaces from your code and use > types instead to enforce that methods are implemented. ... > and so on. Also, I'm not sure interfaces add all that much va

Re: [racket] package server + making docs available early

2014-05-02 Thread Alexander McLin
Looking forward to checking out your Pollen package in more detail, just wanted to add that after reading your original email and following the links, I eventually discovered myself losing a hour or two reading your typographical book. Very nicely written and I look forward to studying it more care

Re: [racket] Macros baffle me

2014-05-02 Thread Robby Findler
I think that the most helpful thing of all would be to submit a pull request to add something to the Racket Guide, after carefully considering an edit to what's there. For now, I'll just cc the list with your encouragement and maybe someone will have the energy to look into this and give it a try.

Re: [racket] Macros baffle me

2014-05-02 Thread Sean Kanaley
Indeed you are correct. I thought about exactly *why* it's bad to use datum->syntax, and it can lead to the kind of behavior I have in the below example: #lang racket (define X 100) (define y 0) (define-syntax (set-y stx) (syntax-case stx () [(_ n) #`(set! #,(datum->syntax #'X 'y) n)])) (le

Re: [racket] package server + making docs available early

2014-05-02 Thread Laurent
On Fri, May 2, 2014 at 5:06 PM, Greg Hendershott wrote: > For smaller/simpler libraries I find futzing with gh-pages enough of a > PITA that instead I just do: > > scribble --markdown manual.scrbl > > The resulting manual.md file is directly viewable on GitHub on a > normal branch like master.

Re: [racket] package server + making docs available early

2014-05-02 Thread Greg Hendershott
I've used gh-pages for bigger libraries and for Fear of Macros. (Although, since the latter is more like a very small book, when I have time I want to check out Pollen instead!) For smaller/simpler libraries I find futzing with gh-pages enough of a PITA that instead I just do: scribble --mark

Re: [racket] Macros baffle me

2014-05-02 Thread Robby Findler
I don't think you want to use syntax->datum or datum->syntax in this macro. Here's another way to write it. Robby #lang racket (define-syntax-rule (with-vars (vars ...) x) (for*/and ([vars (in-list '(#t #f))] ...) x)) (define-syntax-rule (then x y) (implies x y)) (define equ

Re: [racket] Macros baffle me

2014-05-02 Thread Sean Kanaley
Here's a solution (at the bottom) with the datum/syntax converters. flatten is built-in, free-vars is basically filtering stuff and then removing duplicates, with-vars can take advantage of the built-in nested for, and then tauta. tauta can get the "quoted" form of the expression like when you use

[racket] gc crash on raspbian

2014-05-02 Thread David Griffiths
Hi all, I'm running a racket web server on a Raspberry Pi, and occasionally getting aborts with: Unhandled info->type 7 Which I've tracked down to src/racketgc2/newgc.c Any pointers how what this could be and how to fix/work around it? cheers, dave Racket Users list: h

[racket] Final CFP: Workshop on Generic Programming (WGP) 2014

2014-05-02 Thread José Pedro Magalhães
Apologies for multiple postings. == CALL FOR PAPERS WGP 2014 10th ACM SIGPLAN Workshop on Generic Programming Gothenburg, Sweden

Re: [racket] Macros baffle me

2014-05-02 Thread Marco Maggi
"Eduardo Costa" wrote: > In general, I don't have problems with macros in Common Lisp or in > Scheme. However, macros in Racket baffle me. I assume you mean that you are fine with DEFINE-MACRO; hygienic macros are significantly different. You appear to grasp basic pattern matching and outpu