Arc Forumnew | comments | leaders | submitlogin
Srv.arc question
4 points by shader 5397 days ago | 5 comments
Why does respond both call (w/stdout str ... ) and still pass str down to each op, so that they can intermittently call (w/stdout str ...) themselves? Shouldn't it just call w/stdout once, and leave the ops as they are, or is there something I'm missing?


2 points by pg 5397 days ago | link

Hmm, looks like the w/stdouts in the ops are unnecessary. Thanks for noticing.

-----

1 point by pg 5395 days ago | link

Actually on closer examination I'm going to leave the w/stdouts in the op definitions. It's reasonable to have ops take a stream argument, and if they do they have to handle it correctly.

-----

2 points by shader 5395 days ago | link

Mind if I ask what the stream argument could be used for?

-----

1 point by pg 5394 days ago | link

You could for example write to a file or string if you were debugging.

-----

1 point by shader 5393 days ago | link

If it's for debugging, wouldn't it be easier if you just left it going to standard out? That way you could run it on the repl and see the output, and still wrap it in 'tostring or w/outfile if you wanted it to go to a string or file instead.

Maybe the stream argument could be made optional, and default do stdout? The redundancy would still exist, but it would allow us to use it both ways.

-----