[racket-users] warnings for requiring opaque types in typed racket 6.6

2016-08-19 Thread Matthew Eric Bassett
Hi all, I note that Racket 6.6 now issues warnings for certain generated contracts in typed/untyped interactions. In particular, these warnings come up when requiring an untyped file from a typed file. For example, say I have test.rkt: - #lang racket (define my-type (let ()

Re: [racket-users] testing for timeout in Rackunit?

2016-08-19 Thread Mitchell Wand
Thanks! You guys are better than a manual. --Mitch On Thu, Aug 18, 2016 at 7:56 PM, Ben Greenman wrote: > Also try `call-with-limits` from racket/sandbox > http://docs.racket-lang.org/reference/Sandboxed_ > Evaluation.html#%28def._%28%28lib._racket%2Fsandbox..rkt%

[racket-users] Help needed in file processing idioms

2016-08-19 Thread Pekka Niiranen
Hello users, I would like to read lines from a file, process each line and return either the success of the operation or the processed line to another function located in another module. Below are two functions that work OK, but are in my opinion "ugly" because they use "set!". It there a

Re: [racket-users] Help needed in file processing idioms

2016-08-19 Thread WarGrey Gyoudmon Ju
(define (read-on-row *params*) ;; Returns the last line in "myfile" which contains ;; substring "ON", otherwise #f (call-with-input-file (hash-ref *params* "myfile") (lambda (inp) (for/first ([row (in-lines inp 'return-linefeed)] #:when (string-contains? row

Re: [racket-users] warnings for requiring opaque types in typed racket 6.6

2016-08-19 Thread Alex Knauth
> On Aug 19, 2016, at 8:05 AM, Matthew Eric Bassett wrote: > Is there a "correct" way to handle these sorts of cases? The "correct" way right now is to give typed racket the information it needs for chaperoning on it, and unfortunately that means using the `#:struct`

Re: [racket-users] Help needed in file processing idioms

2016-08-19 Thread Gustavo Massaccesi
Minor fix: In the first function "read-on-row" you must replace for/first with for/last. Gustavo PS for Pekka: In this case it's better to use for/last and for/or, but in more complicated cases you can try with for/fold. On Fri, Aug 19, 2016 at 10:34 AM, WarGrey Gyoudmon Ju