• Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

AltME groups: search

Help · search scripts · search articles · search mailing list

results summary

worldhits
r4wp4382
r3wp44224
total:48606

results window for this page: [start: 11101 end: 11200]

world-name: r3wp

Group: Core ... Discuss core issues [web-public]
Ladislav:
9-Aug-2005
...you just need one properly bound variable and you can bind all 
other code using
Chris:
9-Aug-2005
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.
Chris:
9-Aug-2005
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?
Chris:
9-Aug-2005
rely on and == rely on an
Volker:
21-Aug-2005
Maybe they join, the next RAMBO is about entering some bad computer 
and sqush all the bugmonsters there?
Volker:
21-Aug-2005
and in that case i prefer to care mayelf isntead of forcing every 
tool to be aware of it.
Volker:
21-Aug-2005
oh, recursion. and locals on the recursion-stack are not checked 
too?
Volker:
21-Aug-2005
Hope with your bug-example Carl has an easy (and thus quick) time 
to fix it :)
Ladislav:
21-Aug-2005
when we use DO method, we are *declaring* the function as anonymous 
and the interpreter takes care, the only problem may occur, when 
the interpreter handles the function as *named*, although that shouldn't 
matter, because every Rebol function is essentially anonymous
Volker:
21-Aug-2005
it matters because the gc does not scan the c-stack correctly i guess. 
and its using c-stack for nesting.
Volker:
21-Aug-2005
hmm, native functions could have argument-lists like normal ones, 
and then its "named" in that list? could be.
Anton:
22-Aug-2005
I believe, since you can expect the crash to be fixed some time in 
the future, that the solution is to provide both versions of the 
function, the fast, vulnerable version commented, and a note explaining 
when to switch from the slow, safe version to the fast, vulnerable 
version (preferably with test code to prove if your interpreter has 
the crash or not).
MikeL:
22-Aug-2005
Topic - needs or includes.... I am just cleaning up some scripts 
and want to use the dynamic load capability that I thought was enabled 
by pre-requisite setting in the REBOL header.    The only link I 
can find is to the Values.R in the library.   Is there a standard 
approach to this?   Now I am using Carl's %include.r from the script 
library but it does not check for prior loading.
Geomol:
23-Aug-2005
I don't think, it's initially possible to check, if a certain script 
has been loaded or not. One approach, that is often seen in C includes, 
is to have a big 'if' in the script around all the code there, which 
checks on a define, and inside the 'if' define the thing being checked 
on.


I'm searching for a good 'include' myself from time to time. One 
where it's possible to include something without full path. Maybe 
variables like system/options/path, system/options/home or system/options/boot 
should be used.
Geomol:
23-Aug-2005
How do you include "include.r" in your projects? Something like putting 
it in the home directory and type:
do join system/options/home %include.r
Geomol:
23-Aug-2005
The new Core 2.6.0 in View 1.3 is running the user.r found by the 
environment variable APPDATA, it seems. On my Windows computer, it's 
in C:\Documents and Settings\John\Application Data\rebol\ , even 
if I install REBOL/View in E:\rebol\view\. Is it a good way of doing 
it? I find it a bit confusing.
Geomol:
23-Aug-2005
WinXP, that is. I wonder, how it is under Win98, Win2000 and Linux?
MikeL:
23-Aug-2005
Great then I will use include/check as the default usage and may 
save some slow file access time in sub-modules.  Thanks again.
Gabriele:
23-Aug-2005
Geomol: you should be able to change the location of user.r and so 
on during installation (note that installation location and user 
files location are two different places, but can be set to the same 
dir)
BrianH:
24-Aug-2005
Geomol, that way of locating user.r on Windows is really for the 
best. Windows is a multiuser OS after all, and the APPDATA directory 
on Windows is used roughly the same as the home directory on Linux. 
Global settings can be loaded from rebol.r in the same directory 
as the View executable.
Pekr:
24-Aug-2005
I would like once again, if find/match on blocks has correct behavior? 

blk: ["Petr Krenzelok" "Richard Smolak" "Ladislav Mecir"]
find/match blk "Richar"


... will not work, and I would expect it to. At least RebDB gives 
me such functionality and it is nice to have ...
JaimeVargas:
24-Aug-2005
How many global-mezz are necessary. You could code this one your 
self and re-used as needed.
Pekr:
24-Aug-2005
dunno - I would find them being consistent additions and they would 
be fast ...
Geomol:
25-Aug-2005
This reminds me of Tao Elate. In that OS, all library functions are 
small VP asm files on disk. So if you use e.g. printf, only that 
function and not the whole stdlib is loaded in memory. The same function 
is also shared among all running programs minimizing memory overhead. 
Genius, as I see it!


Something like that can be implemented in REBOL with the use of objects 
in objects (that are not multiplied in mem). It's the way, e.g. the 
feel object is implemented in View. To be really efficient, only 
the functions (in the object) needed should be included into mem 
from disk.
eFishAnt:
27-Aug-2005
when you need a reduce/deep and there isn't one, what do you use 
instead?
eFishAnt:
27-Aug-2005
going from VID to literal-words...to do comms syncing...so say a: 
"cat" and b: "dog"  I want [cat [dog]] NOT ["cat"["dog"]]
Volker:
27-Aug-2005
and to be defensive, compose/deep/only.
Brett:
29-Aug-2005
reduce-deep: func [
	block [block!]
	/local queue result file eval-state sub-result
][

	; Initialise
	queue: make list! 10
	result: reduce []


 ; Loop until we exhaust all unfinished blocks and we exhaust current 
 block.
	until [

		either empty? :block [
			; If finished this block, but more to process - add our
			; result to higher block result and set that block as current.
			if not empty? queue [
				set/any 'sub-result get/any 'result
				set [result block] queue/1
				insert/only tail result get/any 'sub-result
				queue: remove queue
			]
		][

			; Process current block item.

			either block? block/1 [
				; Save current level to process later,
				; set this new block as current.
				queue: head insert/only queue reduce [result next block]
				result: reduce []
				block: block/1
			][
				; Evaluate item.
				eval-state: do/next block
				insert/only tail result eval-state/1
				block: eval-state/2
			]
		]

		all [tail? block tail? queue]
	]

	; Return final result
	result
]
Sunanda:
31-Aug-2005
Thanks Anton! We had some fun tuning it (it's done with just REBOL 
objects and blocks by the way)--- It should be even faster if implemented 
on your computer as REBOL.org runs (as far as I can tell) on a shared 
1ghz machine with the slowest hard drives outside of a museum.
Geomol:
5-Sep-2005
context question:
If I inside a context block (an object) in one program write:
do %some-program.r

then I can't reach words and functions in the first program from 
the second. I've also tried to bind words to the first context, but 
without luck. Any ideas? Maybe I should put 2 small test-scripts 
here:
Ladislav:
5-Sep-2005
and, moreover, copy the example I posted, don't forget #include !
Geomol:
5-Sep-2005
So I do
#include %prg2.r
inside mycontext in prg1.r? And then write
include %prg1.r
to run it?
Geomol:
5-Sep-2005
The functionality is very usefull. (Maybe your include can do a bit 
too much. I like it simple.) Maybe I could just do %include.r at 
the start of canvas.r, so people doesn't have to do it in their user.r 
files. Or I should go another way and make it one big file for now!? 
Hmmm well, I would like to do modules later on, so only the parts 
needed is included.
Ladislav:
5-Sep-2005
generally #include %something means "put here the contents of %something", 
while include %something means "find %something, process it and do 
the result"
james_nak:
12-Sep-2005
Oh, and yes, it needs to be empty.
Ingo:
12-Sep-2005
I _think_ that I had the slash, I'll be using delete-dir now. Funny 
thing I didn't know about it ... 
Thanks Gregg and James!
Volker:
12-Sep-2005
yup. And help "set" if it is somewhere in between. Note the {"},else 
it would show help for 'set in this case. (i guess you know that, 
just in case ;)
Pekr:
13-Sep-2005
Hi .... as me and my friend use RebDB, we currently have to simulate 
'join functionality. I gave the idea a little thought, and I remembered, 
there are Rebol natives as 'union and 'intersest. They even do work 
with /skip refinement ..... and we miss that 'join functionality. 
Would it be difficult to add such functionality to work with blocks 
for 'union, or have a new native? I have an example:

; structure - name, last name, address, zip code

table1: [ "Petr" "Krenzelok" "Navsi 645" "739 92"  "Johny" "Handsome" 
"Dreamland 777" "777 77"]

; structure - age, place of birth
table2: [ 33 "Trinec" 38 "Some town"]

join-block/skip table1 table2 4 2


Do you think it would be usefull functionality to have as a native? 
Would be fast and would give us db 'join functionality to some extent 
....
JaimeVargas:
13-Sep-2005
The is the kind of side effects are quite dangerous, imo the current 
behaviour seems like a bug and breaks the least surprise premise.
JaimeVargas:
13-Sep-2005
Why not add a section on the wikibook about "side effect" in Rebol, 
this and other idioms are a must know not only for beginners and 
experts.
Chris:
13-Sep-2005
Perhaps it could come under 'Gotchas' -- it's not a bug so much as 
a 'feature' of Rebol values and contexts?  Just as much as 'copy 
does not automatically 'copy/deep...
Ladislav:
13-Sep-2005
It would be *much* better to suggest the beginners to always use 
CONTEXT instead of MAKE OBJECT! and be safe IMO
Gregg:
13-Sep-2005
My view is that Carl made this a conscious choice, knowing that advanced 
users could do their own copy/deep when they need to, and it won't 
come up most of the time anyway.
JaimeVargas:
13-Sep-2005
We have encounter a lot of Gotchas in our development, and part of 
the reason we are slowed down many times.
JaimeVargas:
13-Sep-2005
We are coding cutting edge stuff. Callbacks, Sophisticated Async 
Networking and others.
Gregg:
13-Sep-2005
Right, and I agree that this kind of thing should absolutely be documented, 
but I also think I understand why it works this way.
JaimeVargas:
13-Sep-2005
So if new users start to code complex applications they hit the problems 
that are not well documented and not easy to catch.
Ladislav:
13-Sep-2005
context: func [
    "Defines a unique (underived) object."
    blk [block!] "Object variables and values."
][
    make object! copy/deep blk
]
Gregg:
13-Sep-2005
And, yes, I think it might be OK for CONTEXT to do a copy on the 
spec; I wouldn't even add the no-copy option,.
Ladislav:
13-Sep-2005
a similar issue exists for USE (use copy/deep spec) , and FUNC (solved 
by my CLOSURE)
Ladislav:
13-Sep-2005
...and MAKE PROTOTYPE-OBJECT SPEC
Gregg:
13-Sep-2005
The biggest risk I see for normal people, is when you're doing things 
like deserializing objects and such.
Gregg:
13-Sep-2005
Why? I don't have to know anything about how REBOL's GC works, do 
I? If *everyone* has to understand and adjust to async, and if even 
10% of people need to know how closures work, that would be a tragedy.
JaimeVargas:
13-Sep-2005
If we are pushing rebol to be capable of handling more and more problem 
spaces, then we need more powerful constructs and excellent docs.
JaimeVargas:
13-Sep-2005
closure, associative arrays, construct with deep copy, load on values 
that don't exist in system object, others. Some of the bugs that 
have been fixed are due to our need for more power, stable and predictable 
interpreter.
Gregg:
13-Sep-2005
stable and predictable; I'm all for that. Beyond the LOAD issue, 
we can do all that, right?
JaimeVargas:
13-Sep-2005
Yes, we can patch rebol and fixed ourselves, but we should remove 
some "surprises" like making CONSTRUCT safe.
JaimeVargas:
13-Sep-2005
I had another issue with the behaviour of APPEND which is different 
for block! hash! than from list! and it is a side effect of INSERT 
and REMOVE
APPEND b: make block! [] [v1 v2] head? b ;== true
APPEND l: make list! [] [v1 v2] head? l ;== false
Ladislav:
13-Sep-2005
actually, it isn't a bug and it is almost impossible to change, but 
it may need a documentation
JaimeVargas:
13-Sep-2005
We need more consistency. I discuss the APPEND issue extensively 
with Ladislav, and it is about docs and side effects. What I fear 
is the explosing of exceptions.
JaimeVargas:
13-Sep-2005
I would like also to be able to implement our own types! and be able 
to overload some words. So that an implementation of associative 
arrays can work look like [make aa! 10] instead of [aa/make 10]
Gregg:
13-Sep-2005
You can propose it. I'm happy to let Carl decide. I wonder if it 
might cause some confusion as it won't be an exact replacement for 
make object!, which it's just a shortcut for. It could break code 
and change behavior if substituted.
BrianH:
13-Sep-2005
I would probably stop using CONTEXT with this change.


I may not be a newbie, but I don't see how this behavior is different 
from the way blocks that aren't explicitly copied are shared throughout 
REBOL. Once you learn this gotcha once (like, the first time you 
make a function with a local block), you have learned it throughout. 
There are always workarounds, and the default behavior can be extremely 
useful if you are expecting it.
Ladislav:
14-Sep-2005
BrianH: nevertheless, you didn't tell me, when would the changed 
CONTEXT cause you any trouble and what kind of trouble?
BrianH:
15-Sep-2005
Ladislav, I frequently use shared data in non-copied data structures 
that are referenced by many objects. This data isn't always in blocks 
- frequently I use hashes, lists or objects. These would be copied 
by your CONTEXT changes too, when my code expects them to stay the 
same. Lists and hashes are not affected by your rebinding problem 
- only blocks, parens and functions are rebound during object creation, 
because only they directly contain code under normal circumstances.


In the past I've found it easier to change the code that treats blocks 
as shared code ckunks into functions, or to make helper functions 
that create and initialize objects appropriately.
Rebolek:
15-Sep-2005
>> none and true
** Script Error: Cannot use and~ on none! value
** Near: none and true
Rebolek:
15-Sep-2005
Looks like 'and is calling 'and~
Rebolek:
15-Sep-2005
>> x: now/time/precise loop 10000000 [true and true] probe now/time/precise 
- x
0:00:03.39
Rebolek:
15-Sep-2005
Hm, 'and is calling 'and~ but is faster than 'and~
Graham:
15-Sep-2005
RT has already stated their priorities viz OSX, SDK, and then IOS. 
 Since Rebol presumably runs already on windows 64 bit version, there 
is no pressing need to develop that product, and so it is logical 
to assume that it falls in priority after all of the above.
Graham:
15-Sep-2005
Do you mean, do the easy things first and leave the hard stuff to 
later?
Pekr:
15-Sep-2005
not sure ... but maybe Genesi sponsored some of Carl's time and convinced 
him it might be important for them to have Rebol ... then Rebol for 
Genesi might be an enabler ...
Pekr:
15-Sep-2005
I can tell you the truth - if there would not be 1.3, I would not 
be with rebol already ... and ppl at ml were right - 4 years to wait 
for View update? I hope it will not happen again ...
Volker:
15-Sep-2005
genesis - this medical firm is in search for an os, isnt it? its 
small, efficent, amiga-like? and ppc is a good embedded processor? 
Just thinking loud :)
Henrik:
17-Sep-2005
>> ? All
USAGE:
    ALL block

DESCRIPTION:

     Shortcut AND. Evaluates and returns at the first FALSE or NONE.
     ALL is a native value.
Graham:
17-Sep-2005
>> true and false
== false
Henrik:
17-Sep-2005
yes, if it's equivalent of AND, that makes sense
Henrik:
17-Sep-2005
but:

>> 1 and 2 and 3 and 4 and 5
== 0
>> 1 and 2 and 3 and 4 and 5 and false
** Script Error: Expected one of: integer! - not: logic!
** Near: 1 and 2 and 3
Henrik:
17-Sep-2005
it doesn't make too much sense as a shortcut AND.... it makes more 
sense to say that it returns a value unless there is a FALSE or NONE 
in the block
Henrik:
17-Sep-2005
if you stick to TRUE and FALSE for ALL and AND, they would be equivalent 
in behaviour. it seems that ALL allows more mixing of the datatypes
Henrik:
17-Sep-2005
it seems not:

>> all [1 2 3 false]
== none

>> (to-logic 1) and (to-logic 2) and (to-logic 3) and (to-logic false)
== false
Henrik:
17-Sep-2005
well it seems to behave like AND, it just returns NONE instead of 
FALSE
Henrik:
17-Sep-2005
so it's not a true shortcut of AND and would fail if you were testing 
for FALSE
Henrik:
17-Sep-2005
this also doesn't work:

>> (all [1 2 3 false]) and (all [1 2 3 true])
** Script Error: Cannot use and~ on none! value
** Near: (all [1 2 3 false]) and (all [1 2 3 true])
Henrik:
17-Sep-2005
a whole lot of things would break if the return value was changed 
from NONE to FALSE. it would be easier to say that ALL is not a really 
true shortcut AND
Graham:
17-Sep-2005
I suggest we submit a RAMBO and wait to see what Carl says ...
PhilB:
18-Sep-2005
How do send an email and cc a second email address 
I tried this

lv-header: make system/standard/email [
    to: [test1-:-somehost-:-com]
    cc: [test2-:-gmail-:-com]
]


send/header/subject [test1-:-somehost-:-com] "This is a test" lv-header 
"Test Subject"

but the email gets sent to the to address but not the cc address.
Graham:
18-Sep-2005
I don't believe that 'send examines the header for cc and bcc fields.
Graham:
18-Sep-2005
you have to rebuild the header for BCC so that the to: address is 
the BCC: address, and the cc: field is none.
Graham:
18-Sep-2005
since BCC means blind copy - ie the recipient should not get to see 
the cc fields, and the email should be addressed to them.
Ladislav:
19-Sep-2005
One "poll" question. How many of you are using function with optional 
argument in your scripts and how much would you miss this feature?
Volker:
19-Sep-2005
its handy for console and i like it there. in programs its more a 
problem.
Geomol:
19-Sep-2005
Nope, I think your +- is fine and short.
Geomol:
19-Sep-2005
I have a question about the order of arguments to a function. I wanna 
hear your opinion. I'm programming REBOL versions of some of the 
Amiga graphics.library functions. BltMaskRGBMap is a function of 
mine, that will copy part of an image at a certain position and size 
to another image through a mask. It takes the arguments: source image, 
source position, destination image, destination position, size and 
finally mask. That would be the order of the arguments, if it was 
an Amiga graphics.library function. But in REBOL, destination is 
often (always?) first, so maybe I should switch source image and 
position with destination image and position? What do you think would 
be the better way for a REBOL programmer?
Ladislav:
19-Sep-2005
When there are both ABS and ABSOLUTE, I would prefer to have both 
+- and NEGATE too
Geomol:
19-Sep-2005
Some say tomato and some say tomahto
Some say potato and some say 
potahto
Tomato, tomahto, potato, potahto
Oh, let's call the whole 
thing off
Romano:
19-Sep-2005
rare case , at least for me,  in my experience, and you can always 
use

add 5 ( - x )

which is also more fast
Geomol:
19-Sep-2005
Taking the example with add, 5, negate and x, we can write:
add 5 negate x
add 5 (- x)
5 + negate x
5 + (- x)
+ 5 negate x
+ 5 (- x)


and using Ladislav's +-: :negate, you can change negate to +- in 
the above. In REBOL there're really many ways to write even the simplest 
thing.
Geomol:
19-Sep-2005
And if x is negative:
5 + - -2
:-)
Tomc:
19-Sep-2005
I am not fond of the idea of using plusminus for negate.  I have 
seen tilde used to denote negation and would perfer something visably 
distinct
11101 / 4860612345...110111[112] 113114...483484485486487