Hi Sunanda,

wow. we must have drasticly different focus on how we use rebol.
I see print str as a shortcut for insert system/ports/output str
i.e. stdout, and piping from script to binary to shell is a daily occurance

an aside, we might also shoot for using /base if it is allowed, (for faster
startup).

#! /home/users/tomc/bin/rebase -sq
rebol []
set-modes system/ports/input [lines: false binary: false]
s: 0 print foreach l parse copy system/ports/input "^/"[s: s + load l]




On 9/27/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> I think it would be great if we clubbed together to generate a set of
> REBOL
> scripts for the computer language shoot-out.
>
> As has already been suggested, we could collaborate on the ML to develop
> and
> refine solutions.
>
> And, ditto, it'd make sense to have a thread per REBOL script.
>
>
> To start the ball rolling, I've picked what is probably the easiest one of
> all: sum-file -- that'll help us get out heads around the various
> requirements.
>
> My draft solution looks like this:
>
> ----------
>
> rebol []
>
> sum: 0
> foreach line read/lines to-file system/script/args [
> sum: sum + to integer! trim line
> ]
> print sum
> quit
> ----------
>
> This needs a command line (cos REBOL doesn't read STDIN) something like:
>
> rebol sum-file.r sum-file-data.txt
>
> And it is **not** a valid solution as the requirements say:
> "Programs should write to stdout. Program output is redirected to a
> log-file and compared to the expected output."
>
> As far as I know, that simply isn't possible with REBOL -- it does not
> write
> to STDOUT -- so we may want to stop the whole exercise right now until
> that
> issue is resolved.
>
> Please comment!
> Sunanda
> --
> To unsubscribe from the list, just send an email to
> lists at rebol.com <http://rebol.com> with unsubscribe as the subject.
>
>


--
... nice weather eh

-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to