Open Oldes opened 5 years ago
type? write %xxx CRLF ; == unset!
is same as R2.
On R3 write
returns a port!
, Red may follow R3 when port! type is ready.
I remember that I asked to make write
return the second argument for R2 but it rejected,
send some@one write %file1 write %file2 data
would be possible. Returning first argument looks less useful than returning second argument to me.
On R3-alpha write
is returning port!
, but closed port and with write only flags used, so completely useless (and I believe it was not intended). As this feature was meant mainly for in console use, returning second argument could be confusing. When I was thinking about it a little bit more, the best would be to return absolute path like:
>> write %temp.txt "hello"
== %/X/GIT/Red/temp.txt
But while returning unmodified file is with no cost, creating absolute path would require computation and so probably not worth the addition.
Now return value from
write
isunset!
in Red:What if it would return the first argument, so one could chain actions? Imagine: