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

World: r3wp

[Core] Discuss core issues

Volker
8-Aug-2005
[1621x2]
(needs recent rebol for the [integer!]-part)
of course instead of third :f1 you can just copy the source for the 
argument-list, and maybe add locals.
Rebolek
8-Aug-2005
[1623x3]
volker it's not exactly what I needed but I can probably do it this 
way
I'll try it, when I get home and let you. Thanks
let you know
Volker
8-Aug-2005
[1626x2]
i thought so. you want to append something to the function body. 
and to make that use the functions variables, you have to re-func-ing.
but i read now again.
Rebolek
8-Aug-2005
[1628x2]
Oh, I did not know I need to re-func it
I'm trying to append something to feel/over so I need to make new, 
expanded 'over and than replace old 'over with the new one, if I 
understand you correctly
Volker
8-Aug-2005
[1630x2]
hmm, not sure what you want to do. the words in the header are not 
bound to the locals, just names. only the words in the body are bound. 
done by 'func.
yes, expand a copy of the body (thats second :over), then make a 
new func with the same argument list. and the old vars are now bound 
to new function.
Rebolek
8-Aug-2005
[1632]
Have to go now, I'll try it at home and let you know.
Volker
8-Aug-2005
[1633]
Bye Kru, hpe it works.
Rebolek
8-Aug-2005
[1634x2]
Thanks
volker thanks, now it does exactly what I wanted and I can expand 
functions
[unknown: 10]
8-Aug-2005
[1636x2]
Has anyone seen an Language overview regarding Performance on funtions 
etc... that includes Rebol ??
somekind of comparisment chart...
Ladislav
8-Aug-2005
[1638]
Bolek, your first example would have worked too, if you did: append 
second :a compose [b (second second :a)]
Rebolek
8-Aug-2005
[1639x3]
Ladislav nice solution!
Or, more generally: append second :a compose [b (first find second 
:a 'value)]
Interesting
Chris
9-Aug-2005
[1642]
; Similar, but you can ensure the position of a word to bind to --
b: func [value][print ["value:" value]]
a: func [value][[value] probe value]
append second :a bind [b value] first first second :a
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
[1670]
system/console/input. if you need chars, not lines, set it to binary 
IIRC.