r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Core] Discuss core issues

Rebolek
9-Aug-2005
[1643]
This is good with one variable, but what if I've got more variables? 
(e.g. three like in [face action event])
Ladislav
9-Aug-2005
[1644x3]
that is even easier. You justg
...you just need one properly bound variable and you can bind all 
other code using
...it
Rebolek
9-Aug-2005
[1647x2]
the problem is I don't know the name of variable so I was trying 
to get the new from function arguments, but I did not succeed
...get the name
Chris
9-Aug-2005
[1649x4]
That makes it difficult -- to bind one context to another, you need 
that word from the target context.  And functions don't have a 'self 
value like objects.  Nor are 'first and 'third values bound to the 
'second.
You could loop through the args (first) to find an appropriate word 
in the body (second), but you rely on and argument word being present 
in the function body -- does that make sense?
rely on and == rely on an
eg. I don't think it'd be possible to bind any block to -- a: func 
[x y][]
Benjamin
15-Aug-2005
[1653]
how can i know how many data is beeing uploaded to a site when using 
write ftp://........we have the read-net or read-thru to know how 
many data is beeing downloaded but what about writing ???
Geomol
16-Aug-2005
[1654x9]
The UNIX cd command (a one-liner) in REBOL:
cd: func ['dir [file! word!] ][change-dir dirize to-file dir]

Now it's possible to type e.g.:
cd ..
cd rebol/view
etc.
Oops! cd rebol/view is not possible. :-)
cd: func ['dir [file! word! path!] ][change-dir dirize to-file dir]

NOW it's possible.
Question to myself: Why didn't I just write:
cd: func ['dir][change-dir dirize to-file dir]


There are many ways to write almost the same thing in REBOL with 
differenct side-effects. Good or bad!? I'm not sure, but it's fun! 
:-)
Another version, that will get to back to system/options/path, if 
'cd' has no argument:


cd: func ['dir [any-type!][either value? 'dir [change-dir dirize 
to-file dir][change-dir system/options/path]]
get to
 = "get you"
I put REBOL versions of many often used UNIX commands in a "unix.r" 
script, that I put in my rebol/view directory, so I can easily get 
to them, when I have to use the REBOL prompt. Just an idea for others.
An easy one:

pwd: :what-dir
Anton
17-Aug-2005
[1663]
There's also the group "*nix-sh" for discussing this.
Geomol
17-Aug-2005
[1664]
Thanks!
Graham
18-Aug-2005
[1665]
*nix-sh is a private group ...
Anton
18-Aug-2005
[1666]
Any reason why I shouldn't make it public ?
Volker
18-Aug-2005
[1667]
IS there something terrible in it which annois some people, like 
hard religion or something? Else i see none.
Anton
18-Aug-2005
[1668]
ok now it's public.
JaimeVargas
19-Aug-2005
[1669]
How can I read any char from stdin?
Volker
19-Aug-2005
[1670x2]
system/console/input. if you need chars, not lines, set it to binary 
IIRC.
or [lines: false]? something like that.
Anton
19-Aug-2005
[1672]
using SET-MODES I think
Henrik
21-Aug-2005
[1673]
Suggestion: ATTEMPT offers no possibility to provide a default value 
in case of failure. How about:

attempt/failure [2 / 0] "Invalid!"
== "Invalid!"

attempt [2 / 0]
== none

default-values: [a b c]

values: copy attempt/failure [read %values-file] default-values

2% more elegance? Or a debugging trap?
Volker
21-Aug-2005
[1674]
inbuild:
values: copy any[attempt [read %values-file] default-values]
Ladislav has something like your suggestion, called 'default.
Henrik
21-Aug-2005
[1675]
not as clear, but I resorted to this when wanting to read out 0 when 
a numeric computation that is always positive failed:


first maximum-of reduce [0 attempt [2 / 0]] ; what's going on? .... 
oh :-)

attempt/default [2 / 0] 0 ; seems more clear
Volker
21-Aug-2005
[1676x2]
He did not patch attempt, its own. so
 default [ 2 / 0 ] 0  ; IIRC
default [read %values-file] "This file missing"
Henrik
21-Aug-2005
[1678]
found it in RAMBO #3225...
Volker
21-Aug-2005
[1679x3]
one version is here, with explicit error-variable: http://www.fm.vslib.cz/~ladislav/rebol/default.r
- ah, you too.
interesting, i googled for "ladislav default", no "rebol" in it, 
42k hist, this one #4 :)
hist -> hits
Henrik
21-Aug-2005
[1682]
google thinks rambo is a movie character. how quaint!
Volker
21-Aug-2005
[1683x3]
But always in the center of the action?
But why would an actor call himself after a broker?!
ups, no, rambo, not rugby. bug-squasher then.
Henrik
21-Aug-2005
[1686]
Rebol will have sufficient fame when Stallone sues over the RAMBO 
name.
Volker
21-Aug-2005
[1687]
Maybe they join, the next RAMBO is about entering some bad computer 
and sqush all the bugmonsters there?
Robert
21-Aug-2005
[1688]
Does read/skip work in the new releases?
Anton
21-Aug-2005
[1689]
Doesn't look like it. I think file skip was removed because of moving 
to new Windows api.
Pekr
21-Aug-2005
[1690]
When will open/seek be added? It was supposed to be there with new 
async core, we had async core for a while, but I do not remember 
anyone mentioning open/seek is there ...
Anton
21-Aug-2005
[1691x2]
you mean  "file seek"   or  "open/skip".
It was in the experimental releases, like View 1.2.57.3.1
Test with a line like:
	print copy/part read/skip %user.r 10 40    ;   compare 10 with 0