[racket-users] For/lists: where is #:continue?

2015-07-13 Thread Pekka Niiranen
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)))

[racket-users] Re: For/lists: where is #:continue?

2015-07-13 Thread Pekka Niiranen
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

[racket-users] Re: For/lists: where is #:continue?

2015-07-13 Thread Pekka Niiranen
(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

[racket-users] Re: How to return summary from the inner loop?

2015-07-10 Thread Pekka Niiranen
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

[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-20 Thread Pekka Niiranen
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

[racket-users] Racket -script running other Racket scripts

2016-08-21 Thread Pekka Niiranen
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)