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

World: r3wp

[Core] Discuss core issues

Janko
8-Feb-2009
[12306]
hm, I see there is system/words but I didn't manage to really see 
what's in because if I probe it it blocks my computer , too many 
words probably..
[unknown: 5]
8-Feb-2009
[12307]
;just use:

first system/words
Dockimbel
8-Feb-2009
[12308]
or >> help system/words
Janko
8-Feb-2009
[12309x3]
hi Paul ... yes, I just am hacking that :) this is how I got my defined 
words:  next find first system/words 'et .. well at least names of 
them
(and Doc)
hm.. now it doesn't work
[unknown: 5]
8-Feb-2009
[12312x2]
Janko, what a lot of us do when we build a script is create one large 
object and build our functions and values off of it.
Then instead of looking through first system/words you can simply 
do first whatever-your-object-name-is.
Will
8-Feb-2009
[12314]
word-block: func [/init /dif /list /show /local f t w][
	if init [
		init-words: query system/words
		query/clear system/words
	]
	if dif [intersect init-words query system/words]
	if list [query system/words]
]
Janko
8-Feb-2009
[12315]
aha, yes.. this is good option... but if it's possible without this 
it would be even better.. so you are not limited
Will
8-Feb-2009
[12316]
old stuff, not sure.. ;-)
Janko
8-Feb-2009
[12317x2]
(my answer  was to Paul)
Will: what does word-block do?
Will
8-Feb-2009
[12319]
launch rebol, then word-block/init, define some words, then word-block/dif 
should get you your defined word!
[unknown: 5]
8-Feb-2009
[12320]
Janko, that is up to each on how they desire to code.
Janko
8-Feb-2009
[12321x2]
ok, so I get list of words .. but can I export (write to file) sources/definitions 
of functions ?  >> source somefunc<< prints it but I would need to 
get a string
aha Will I will try
Will
8-Feb-2009
[12323]
sorry, word-block/list not /dif ..
Janko
8-Feb-2009
[12324x8]
yes, I agree... I am asking because if this could be done then you 
could use rebol in a same way as smalltalk and factor are which are 
"image based" languages ... this brings some interesting usages..
for example a server that can replicate itself... or save it's state 
and then run from exactly same state, or in games, editing them without 
restarting... editing "live image" which should be possible because 
you can redefine words in rebol, but then you need to save whole 
current state.
(that was the reason why I wanted to embed smalltalk into game engine, 
but I would much rather do this with rebol)
aha!!!
print join mold first :bbbb mold second :bbbb ; bbbb is some func
Will, your word works great :)
I will experiment a little with this when I find time, thanks all
hm.. what am I speaking crazy stuff, or where did you all go? :)
[unknown: 5]
8-Feb-2009
[12332]
Janko, I had left to shower and eat lunch.  Sorry, but you need to 
check the status on the left.  Often times we just disappear.  That 
is kinda what is nice about Altme in a sense is that you know when 
someone is available or here now by the status.
Janko
8-Feb-2009
[12333]
:) I was joking .. no problem at all
Gabriele
9-Feb-2009
[12334]
Janko, the short answer is that you can... except for bindings. (So, 
in general, no, you can't just save the current state of an app, 
unless the app is designed for that from the start.)
Janko
9-Feb-2009
[12335]
can I ask what does it mean "except for bindings" ? you mean like 
native code libs (bindings) .. or binding in rebol sense which I 
heard about, but don't fully understand what it means
Henrik
9-Feb-2009
[12336]
He means rebol bindings. This is a good read on bindings: http://www.fm.tul.cz/~ladislav/rebol/contexts.html
Will
9-Feb-2009
[12337]
where is Ladislav? buuuu 8(
Janko
9-Feb-2009
[12338]
Henrik, thanks I will read it
Henrik
10-Feb-2009
[12339]
Was CHMOD ever implemented for the FTP scheme in REBOL 2?
Anton
10-Feb-2009
[12340x2]
I don't think so, no.
That is, it was never built in. Somebody might've hacked it in for 
their particular situation.
Henrik
10-Feb-2009
[12342]
ok, thanks
Janko
12-Feb-2009
[12343x4]
This is continued from the talk we had with BrianH in the R3 group.. 
but it's R2 code so  (about do/next)
paralel doer:
para-do: func [ codes- /local codes cnt values code- value- all-done 
] [
  codes: copy codes-
	cnt: length? codes
  values: make block! cnt
	loop cnt [ append values none ]
	until [ 
		all-done: true
		repeat idx cnt [
			code: pick codes idx
			if not empty? code [
				set/any [ value- code- ] do/next code
				codes/:idx: code-
				values/:idx: value-
				all-done: false
				print mold value-
			]
		] all-done
	] 
	values
]
usage example: 

>> codes: [ [ a: 12 + 23 b: a + 100 c: b * a ] [ t: join "aaa" join 
"bbb" "ccc" find t "b"  ] ] 
>> para-do codes
35
aaabbbccc
135
bbbccc
4725
== [4725 "bbbccc"]
(it collects results of all blocks when done and returns them)
BrianH
12-Feb-2009
[12347]
I wonder if we can do MAP-REDUCE in REBOL :)
Janko
12-Feb-2009
[12348x4]
(it throws error on expressions that retun unset like print .. because 
value- get's undef, but it can probably be made to work)
I think it should be perfectly possible
also.. something para-do could be made so that it would send code 
blocks to multiple rebol processes via tcp or pipes maybe and collect 
results back
it can do 1000 blocks with 5 expressions in 0.03s on my (little slower) 
comp , 10.000 in 0.25s , 100.000 in 3.75s ... so it seems stepping 
the blocks is not horribly slow, and I am sure my func could be made 
better
Steeve
12-Feb-2009
[12352]
clearly, it could be faster but i'm not sure of the interest of such 
thing. If i want a small granularity in a process, i build tiny functions 
and push them in a to-do stack
Janko
12-Feb-2009
[12353]
I am also not yet sure how/if this could be usefull :), but as I 
said it's very impressive that you can do that (I have to go to sleep 
now)
Tomc
13-Feb-2009
[12354x2]
I want to partition a block in place ,that is wohout copy.. 
e.g. 
blk: [ red green blue plum apple orange ]
partition  blk 3
>>  [ [red green blue] [ plum apple orange ] ]
without