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

World: r3wp

[Core] Discuss core issues

Volker
27-Jan-2005
[369x3]
Thats what series are about. :) And we can make our own using ports 
:)
about Roberts stack: most of that is inbuild in series, so why wrap/rename 
it?
Thats something Carl blogged about: Idioms http://www.rebol.net/article/0101.html
would be:
push -> insert stack value
pop -> remove stack ; does not return the value. 

top -> stack/1 ; with path, the if empty? stack[return none] is implicit
Gregg
27-Jan-2005
[372]
POP is about the most useful method that isn't built into REBOL. 
It's nice to be able to remove something and have it returned, rather 
than having the series returned.
Volker
27-Jan-2005
[373x3]
my push/pop has the advantage that it pushs/pops a group of variables, 
instead of single values. sometimes handy with recursive parsing.
(and 'pop knows which variables where pushed, so just "pop", not 
"pop[a b]")
pop: partly agreed. but i use the top of stack directly, and poping 
really means "no longer needed.
i don't use   push var  change var   pop var
but   push value   use stack/1   pop
Terry
27-Jan-2005
[376]
Is there someway to have a function stored as a string, and then 
do it, without triggering the actual function name? ie:

N: {o: func [inpu][print join inpu "ing"]}

so that i get.. 

do N "test"
>> testing
Volker
27-Jan-2005
[377]
do do N "test"
Terry
27-Jan-2005
[378]
hehe, thanks
Geomol
27-Jan-2005
[379]
So far I've push'ed and pop'ed stacks (blocks) at the bottom, because 
I presure, it's faster that from the top (because of memory allocation). 
But I haven't actually tested it, and if it's true in all cases. 
Does anyone have experience with that?
Terry
27-Jan-2005
[380x4]
boo-boo: func [inpu][if error? try inpu [print "error"]]
boo-boo [do do N "test"]
Looking at 'ALTER.. shouldn't there be a similar word that "If a 
value is not found in a series, append it; otherwise, DO NOTHING?
In other words.. i want to check the series to see if the word exists.. 
if not, add it..
Seems this should be an argument for 'ALTER

addWord: func [ser wrd][if not find ser wrd [append ser wrd]]
Tomc
27-Jan-2005
[384x3]
unioning your test word with your block of words may work
color: [ red blue green]
== [red blue green]
>> color: union color [red]
== [red blue green]
>> color: union color [yellow]
== [red blue green yellow]
>>
Robert
28-Jan-2005
[387x2]
stack: Gregg, yes these are true words about using the same name. 
But let's face reality, those data-structure stuff is quite old and 
is learned at university. Most programmers are used to them. And 
from the name of the functions I can implie to the datastructure 
used. Someone not common with Rebol might not "see" that this simulates 
a stack.
You need to know the common sense data-structures anyway. But to 
be honest, the code is quite dated. I use it in MDP to handle the 
parsing state.
Graham
28-Jan-2005
[389]
anyone know what causes an error 

** user error: system error: tcp
Geomol
28-Jan-2005
[390]
make error! "system error: tcp"

maybe?
Graham
28-Jan-2005
[391]
no .. not in this instance.
Gregg
28-Jan-2005
[392]
So far I've push'ed and pop'ed stacks (blocks) at the bottom, because 
I presure, it's faster that from the top (because of memory allocation)

 -- Yes. For block! values that is very true. For list! values it 
 isn't. For blocks it's a zillion times faster...well, for small blocks 
 it's faster and for big ones it's a *lot* faster. If you're making 
 a million changes to a 10,000 item block, it's a big difference.
Guest
30-Jan-2005
[393x2]
Q: how can I determine the pointer for a struct!  (or variable)  
for passing this pointer  to a external dll ?
or better explained, howto create a pointer. is there something like 
to-pointer ?
Gabriele
31-Jan-2005
[395]
if you pass the struct, a pointer is automatically passed. anyway, 
Ladislav has functions to get pointers to memory. I don't have the 
link at hand though...
eFishAnt
31-Jan-2005
[396x3]
you need a pointer to Ladislav's URL struct!    ;-)
took a while to find this ... http://www.fm.vslib.cz/~ladislav/rebol/
not sure that Gab's reference is there, but tons of goodies there...wow!
Gabriele
31-Jan-2005
[399]
http://www.compkarori.com/vanilla/display/peek_and_poke.r
Graham
31-Jan-2005
[400]
anyone recall offhand what the function is that decodes url encoded 
text back to normal?
Tomc
31-Jan-2005
[401]
decode-url
Graham
31-Jan-2005
[402x3]
that takes a url
I'm just looking for the function that decodes the text and returns 
text, and not an object
it's likely to be called by decode-url
Tomc
31-Jan-2005
[405]
there is a parse-url  but it is burried in an objecr and not public/global
Graham
31-Jan-2005
[406]
yeah, it's in there somewhere
Tomc
31-Jan-2005
[407]
see ?? decode-url
Chris
31-Jan-2005
[408]
dehex?  (preceded by replace/all text "+" " ")
Graham
31-Jan-2005
[409]
dehex looks good :)
Geomol
31-Jan-2005
[410]
Remember & < and > if you have any of those in the text. 
Shall be replaced by &, < and >.
Tomc
31-Jan-2005
[411x2]
graham there is a  web-to-plain.r  at http://www.cs.uoregon.edu/~tomc/
that may work for you
if you have more char enties than just hex encoding
eFishAnt
31-Jan-2005
[413]
there were some note on it in Core release notes IIRC, de-hex and 
decode-url
Graham
31-Jan-2005
[414x2]
the microwebserver at http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=webserver.r
doesn't decode spaces etc so comes a cropper if the file on disk 
has a space in it.
The authors, not mentioned, were "Tyler Booth" "Jeff Kreis" "Bohdan 
Lechnowsky"
eFishAnt
31-Jan-2005
[416]
http://www.rebol.com/docs/changes.htmlnot so much on decode-url, 
but decode-cgi yes.
Guest
8-Feb-2005
[417]
how to: create a array of objects ? (like arrays of udt's)
Sunanda
8-Feb-2005
[418]
blk: copy []
loop 10 [append blk make object!  [a: 1]]