[REBOL] RugbyXPi - first steps (and bugs?) ...
From: petr:krenzelok:trz:cz at: 25-Jan-2002 8:30
Hi,
first steps with new Rugby .... strange result ...
->> start-profiling "pass"
== "Profiling started."
->> start: now/time/precise loop 100 [echo "la"] print now/time/precise -
start
0:01:23.59
(I am not sure if the slowdown was because of profiler or because of ZoneAlarm
firewall)
->> print profile-data "pass"
** Math Error: Attempt to divide by zero
** Near: to-integer (to-decimal val/1) / (to-decimal time) *
->> reset-profiler "pass"
== 8:14:46.78
Now the question - does 'reset-profiler only resets the profiler, or does it
stop it?
a) if it stops profiling - rename the function, please
b) if it only resets profiler data, then add function to stop profiling ...
New try to use profiler:
->> start-profiling "pass"
** Script Error: Duplicate function value: profiler-data
** Near: func compose [(do mold header) /profiler-data profiler-ticket return
exit]
compose/deep [
profiler-data: (copy/deep [[]])
either empty? profiler-data
[
repend profiler-data
[
return: func [[throw] value [any-type!]]
[
profiler-deregister profiler-ticket
system/words/return get/any 'value
]
exit: func [[throw]] [return]
]
]
[
set [return exit] profiler-data
]
profiler-ticket: profiler-register (name)
set/any 'val do (reduce [body])
profiler-deregister profiler-ticket
get/any 'val
]
What I still can't get used to:
- naming confusion - start-PROFILING, reset-PROFILER, PROFILE-data ... what
about profiler/start, profiler/reset, profiler/stop, profiler/get-data = only
ONE function and its refinements to remember .... believe me - it is difficult
for me to remember all that function name variants and required order of words
in function names ....
- I forget to send password parameter to above functions each time :-) Maybe
it is just because it is rather new functionality ... let's see how it will
evolve ...
Let's get Rugby being smart for its users :-) Well, on the other hand, if we
will use refined functions, what equivalent will Ruby users use? ;-)
Cheers,
-pekr-