Hello users,
What is the proper design pattern to skip invalid values
when using for/list?
The programs below fails because #:continue is not recognized:
for/list ([i (in-range 0 1000)])
(let ((value (vector-ref vector i)))
(if ( 0 (length value))
value
#:continue)))
wrote:
I think you're looking for #:when / #:unless.
On Mon, Jul 13, 2015 at 3:12 PM, Pekka Niiranen
pekka.niira...@pp5.inet.fi wrote:
Hello users,
What is the proper design pattern to skip invalid values
when using for/list?
The programs below fails because #:continue is not recognized
(sub1 end))]
[s (in-value (vector-ref vector i))]
[columns (in-value (string-split s ,))]
[col# (in-value (length columns))]
#:when ( 2 col#))
(first columns))
On Mon, Jul 13, 2015 at 3:46 PM, Pekka Niiranen
pekka.niira...@pp5.inet.fi wrote
Thanks Sir,
This was exactly what I tried to reason.
It never occured to me that parameter failure can be used
in both for/fold -constructs.
About the problem (Stephen):
value-list: '(5, 15, 25)
low-list: '(1, 11, 21)
high-list: '(10, 20, 30)
I need to check the following 9 cases:
LV
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
ns
>>;; substring "ON", otherwise #f
>>(call-with-input-file (hash-ref *params* "myfile")
>> (lambda (inp)
>>(for/or ([row (in-lines inp 'return-linefeed)])
>>(string-contains? row "ON")
>&g
Hello users,
I am trying to eradicate *.bat files running Racket scripts.
What is the idiom to make Racket script to start itself recursively
(system, process, subprocess) when main script is started from shell
and all outputs are printed to console?
"racket mscript.rkt args" => (system *.bat)
7 matches
Mail list logo