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
wrote:
> (define (r
> 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` option
in require/typed.
(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 "ON"))
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 w
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%
> 29._call-with-limits%29%29
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 ()
(struct
6 matches
Mail list logo