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

World: r3wp

[Core] Discuss core issues

Henrik
28-Jul-2007
[8572]
yes, a lot of them also has "Returns TRUE..." in their help text
Geomol
28-Jul-2007
[8573x2]
I don't think, the programmers have to worry about actions, and therefore 
you can say, they're confusing. Calling them all natives would be 
ok with me.
Most (all?) of the ones returning TRUE is the "...?" words. Then 
it might be strange, why not all "...?" words are actions. See:
>> ? "?"
Henrik
28-Jul-2007
[8575]
well, value? is a native, because it only accepts word! ?
Geomol
28-Jul-2007
[8576x2]
That some of them are functions can be explained (they're mezzanines). 
But some of them are natives, which is strange to me.
input? is also a native.
Henrik
28-Jul-2007
[8578]
hmm.. script accepts multiple datatypes. I don't think it's about 
that. It's probably only about how it's implemented internally.
Geomol
28-Jul-2007
[8579]
Can you find an action, that only take one type of data? :-)
Henrik
28-Jul-2007
[8580x3]
the full quote from earlier:


action values are native code, just invoked through type-specific 
indirection. APPEND would likely be an action value because its implementation 
would be different for each type you are appending to.
I think it's purely an implementation issue. If APPEND in R3 was 
a native rather than an action, it would not be able to use as many 
types as arguments as it does.
and APPEND in R3 is an action, so Brian is right there.
Gabriele
28-Jul-2007
[8583x3]
LOL, so it's me that defines whether rebols are "programmers" or 
not? :)
indeed, difference between native and action is how it is implemented.
actions are implemented as "methods" for the datatypes. natives are 
more like normal C functions.
Henrik
28-Jul-2007
[8586]
I'll write that in my blog post :-)
btiffin
28-Jul-2007
[8587x2]
Has anyone ever written a version of clean-script.r that will (attempt 
to) pretty print at email safe 80 column limits?
Geomol;  The  quit: :halt works...as long as you are used to typing 
"q" to leave the console.  Otherwise you get stuck trying to actually 
quit.  I think there is more thinking...
btiffin
29-Jul-2007
[8589x2]
Ok...is there a function that emulates the behaviour of flowing through 
a script?

Outter.r
rebol []


while [true] [print "calling inner" do %inner.r  print "called inner"]

Inner.r

rebol []

if confirm "Quit? " [quit]
if confirm "Halt? " [halt]
if confirm "Break? " [break/return 10]
print "Bottom of inner"


The only way I can get outter.r to continue the while loop is by 
answering No to all the prompts and flowing through.  I'm questing 
for a way to get out of a do'ed script without breaking outter and 
recoding the whole inner script to have it flow through.  I'd like 
to be able to use do and not launch or call.
Thanks gentlemen;  Found a solution.  catch and throw.
outter.r

while [true] [print "doing inner" catch [do %inner.r]  print "done 
inner"]

inner.r
rebol[]
if confirm "Throw? " [throw "some value"]
print "Bottom of inner"


And with /name, why I think I'll write spaghetti.r    Just kidding. 
 rebols don't cook spaghetti.
Gregg
29-Jul-2007
[8591]
I don't know of a width-limited formatter, but it would be a good 
thing to have.
btiffin
29-Jul-2007
[8592]
Gregg; I started mucking with it.  The first blaring implication 
is splitting comments...it means actually modifiying the source.
Gregg
29-Jul-2007
[8593]
Yes, that's the first problem I see as well.
Henrik
31-Jul-2007
[8594]
when doing a read/part http://www.somewhere.com500


does it really only read the first 500 bytes, or does the server 
deliver everything and REBOL just cuts it down to 500 bytes client 
side? it seems to take an equal amount of time to read 500 bytes 
and 100 kb.
Graham
31-Jul-2007
[8595]
it reads everything
Pekr
31-Jul-2007
[8596]
really? What is that refinement there for then? :-) Well, it might 
be understandable - read in opposite to open just can't be so fine-grained 
...
Henrik
31-Jul-2007
[8597]
it probably depends on the webserver, if it will deliver only part 
of the page or not.
Pekr
31-Jul-2007
[8598]
IIRC I tested open/part and skip and it worked, but it was long time 
ago ...
Gabriele
31-Jul-2007
[8599]
R2's HTTP does not support that kind of things.
Geomol
1-Aug-2007
[8600]
I'm so irritating happy today! :-D (You may not be able to say such 
in english, but it works in danish.)
Henrik
1-Aug-2007
[8601]
it does? :-D
Geomol
1-Aug-2007
[8602x2]
Ops, wrong channel, that should have been in the "Chat" group.
Oh my, I'm just irritating! :-)
Pekr
4-Aug-2007
[8604]
Today I was thinking about REBOL paths and namespaces navigation 
"problem". I would like some clever persons 

here, to educate me a bit in that area. So far I think, that REBOL 
breaks on some path rules, of course it 

depends, upon what "philosophy" you provide as an explanation. So, 
I was thinking about 

namespaces/paths/context, as of a tree .... So, all words are defined 
in top (global) context = root, right? 

(excuse simplification). Then comes first question - how can be following 
valid?:

a: 5
b: context [print a]


My objection is, that from the point of  'b "node", there is no 'a. 
So, my explanation is:

1) in the case of directory, we would use ../a
2) or we should go via root reference - b: context [print /a]

3) we create "philosophical" rule, stating that global (top) context 
words are propagated to subsidiary nodes 
(contexts)


I don't mind case 3), if such rules are well defined, and it will 
come, once we switch to modules.


How did I came to think about above? I have somehow aesthetical issue 
with REBOL, when I look at e.g. scheme 

code in R2. It is full of awfull system/words/word references. I 
don't like it. What I would like to see is to 
have some abbreviations. I know that we can do e.g.:

_print: system/words/print


My question is, if we could have some more abstracted solution? Do 
you remember 'with keyword? I don't 

remember how it worked, but I would like to have some ability to 
"bind" particular word from existing context 
to actual context:

bind system/words node here, so that I don't need to use paths
 (kind of like when you create links in unix 
filesystem hierarchy ....


Of course, here we go - we could easily get some colision, e.g. if 
target context contains the same words. But 

maybe that could be somehow taken care for (I thought e.g. about 
automatic adding of underscores, e.g. _print, 
but that is not good solution).


Well, the thing is, that I am not actually even sure, what am I asking 
for :-) So, I would like to ask, if 

some REBOL gurus thought about such topics, or am I completly unrealistic 
here?

Thanks ...
Geomol
4-Aug-2007
[8605]
Some thoughts:

Case 3) is like in object-orientated languages. You inherit words 
from parent context (object or class) and can use them right away 
without any further syntax.

You'll probably see system/words/word references in cases, where 
it is words that very like get reused/redefined. So it's typed like 
that to make sure, it's the system definition of the word, that is 
being used.

I'll give you, it's not the most pretty and easy to read. Maybe some 
use of BIND can avoid it.
btiffin
4-Aug-2007
[8606]
Pekr;  I'm kinda of kidding, but not.  Avoid Multiple Inheritance 
 it a plague :)
Gabriele
4-Aug-2007
[8607]
Petr, there is no such hierarchy in REBOL. there is no "parent" or 
"child" context.
Pekr
4-Aug-2007
[8608x2]
and maybe that is wrong?
I remember QNX, everything in system was hierarchical, accessible 
via nodes. As you think of compositing engines, networking, filesystems, 
- all use hierarchies/trees. I just thought that because REBOL got 
paths, we could put more thoughts to it and make it an universal 
aproach :-)
Gabriele
4-Aug-2007
[8610x2]
that is not wrong.
and, changing that would mean making something that is not rebol 
anymore.
btiffin
4-Aug-2007
[8612]
I agree.  Relative context is the way to go.  (But, always a but), 
Petr's point about system/words/copy inside the scheme overlays seems 
a little, hacky? for such core functionality.  I'd almost prefer 
to see the scheme front end code made a little more complex and include 
a uses block or some such that allows clear mapping from redefined 
words to 'previous' behaviour.
Gabriele
5-Aug-2007
[8613x2]
who makes you think that the system/words/copy thing happens in R3 
schemes?
who = what
Geomol
5-Aug-2007
[8615]
:-) Nice!
btiffin
5-Aug-2007
[8616]
I was hoping..., but didn't want to say anything.  :)
Joe
14-Aug-2007
[8617x2]
hi, how do I go about timing out ports opened with direct/no-wait
thanks
Pekr
14-Aug-2007
[8619x2]
what do you mean by timing out?
when you use direct/no-wait, it does not wait. You have to explicitly 
call wait to get events. Also copying from port does not block ...
sqlab
14-Aug-2007
[8621]
Hi Joe
something like 
either port: wait reduce [opened-port1 opened-port2 timeout] [
	print "data available"
	probe copy port
] [
	print "timeout"
]