[REBOL] Andrew, you beast! - GC too tidy? Re:(3)

2000-06-15 Thread Petr . Krenzelok



[EMAIL PROTECTED] wrote:

> Just a thought  most of the "philosophical" questions / discussions here
> about i.e. object lifecycle, scope, bindings, etc. would be simply,
> formally, and workably solved if Rebol had a true lexical scoping model.  As
> it is, it's sort of the worst of both worlds:  it's semi-fluid scope with
> explicit manipulation coupled with a sort of hybrid object / object
> lifecycle model that is never really formally elaborated.  Without knowing
> the internal nitty gritty of the implementation, it's hard to say if this is
> endemic to Rebol or not, but looking at i.e. the potential solutions to
> similar problems in early Lisps vs. Scheme, I'd say there's a whole lot of
> good reasons for solving the problem now.

Just a note - isn't it too late, if two book on REBOL are already finished?
Elan, Ralph? :-)

-pekr-

>
>
> jb
>
> [EMAIL PROTECTED] wrote:
>
> > Nicely described Galt :)
> >
> > > I suppose it means you
> > > can bind a block to another block or word
> > > and it will share the context of that other
> > > block.  I wonder what would happen if you
> > > unset O at this point.  Could you still
> > > run Dialect and have it bind and reduce another block
> > > to what O was bound to?
> >
> > Tried it, yup it will and it won't work.
> >
> > It will for a bit until the garbage collector takes away O.
> >
> > Try
> >
> > Create O as in the example.
> >
> > Dialect [f1 f2] ; --Ok
> > Unset 'O ; -- oh oh , could be trouble coming
> >
> > Dialect [f1 f2] ; --Still worksPhew.
> >
> > Recycle;
> > Dialect [f1 f2] ; * Crash * -- Looks like the GC was a bit enthusiastic.




[REBOL] Andrew, you beast! - GC too tidy? Re:(2)

2000-06-15 Thread jbone


Just a thought  most of the "philosophical" questions / discussions here
about i.e. object lifecycle, scope, bindings, etc. would be simply,
formally, and workably solved if Rebol had a true lexical scoping model.  As
it is, it's sort of the worst of both worlds:  it's semi-fluid scope with
explicit manipulation coupled with a sort of hybrid object / object
lifecycle model that is never really formally elaborated.  Without knowing
the internal nitty gritty of the implementation, it's hard to say if this is
endemic to Rebol or not, but looking at i.e. the potential solutions to
similar problems in early Lisps vs. Scheme, I'd say there's a whole lot of
good reasons for solving the problem now.

jb


[EMAIL PROTECTED] wrote:

> Nicely described Galt :)
>
> > I suppose it means you
> > can bind a block to another block or word
> > and it will share the context of that other
> > block.  I wonder what would happen if you
> > unset O at this point.  Could you still
> > run Dialect and have it bind and reduce another block
> > to what O was bound to?
>
> Tried it, yup it will and it won't work.
>
> It will for a bit until the garbage collector takes away O.
>
> Try
>
> Create O as in the example.
>
> Dialect [f1 f2] ; --Ok
> Unset 'O ; -- oh oh , could be trouble coming
>
> Dialect [f1 f2] ; --Still worksPhew.
>
> Recycle;
> Dialect [f1 f2] ; * Crash * -- Looks like the GC was a bit enthusiastic.




[REBOL] Andrew, you beast! - GC too tidy? Re:(2)

2000-06-15 Thread Al . Bri

:-)

It would be really, really nice if Rebol's Garbage Collector worked
properly.
:-(

Andrew Martin
ICQ: 26227169
http://members.xoom.com/AndrewMartin/
-><-




[REBOL] Resume getting a web page? Re:(3)

2000-06-15 Thread allenk


- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 16, 2000 7:16 AM
Subject: [REBOL] Resume getting a web page? Re:(2)


>
> On 15-Jun-00, [EMAIL PROTECTED] wrote:
>
> > Sterling posted to this list on Monday that some (experimental)
> > patches that do what you want had been posted to:
> >http://www.rebol.org/unsupported/
>
> > Check those out and see if they do what you're looking for.
>
> Thanks, Kevin, but this failed to get the complete page, as well.
> REBOL failed around the same length the browsers failed.

Hi Donald,

It might be that the server or a proxy server between you and the page is
returning an incomplete page.
My bet would be a proxy server that is too stupid to realise it doesn't have
the complete resource.

Allen K





[REBOL] Resume getting a web page? Re:(2)

2000-06-15 Thread ddalley


On 15-Jun-00, [EMAIL PROTECTED] wrote:

> Sterling posted to this list on Monday that some (experimental) 
> patches that do what you want had been posted to:
>http://www.rebol.org/unsupported/

> Check those out and see if they do what you're looking for.

Thanks, Kevin, but this failed to get the complete page, as well.
REBOL failed around the same length the browsers failed.

-- 

---===///||| Donald Dalley |||\\\===---
 The World of AmiBroker Support
  http://webhome.idirect.com/~ddalley
  UIN/ICQ#: 65203020




[REBOL] How and when is bind useful? Re:(2)

2000-06-15 Thread bhandley

> what-not: [
> empty? trim/all copy line
> found? find trim/all copy line "WEIGHTNAMEOFPRODUCT"
> found? find radek "==="
> (to-char first radek) = (to-char 12)
> ]
>
> foreach line file [if not any bind what-not 'line [insert tail result
> line]]

Thanks Pekr.
I didn't realise that when binding a block only the words in the block that
can be found in the context will be bound.

Brett.




[REBOL] pseudo-globals? Re:(2)

2000-06-15 Thread Galt_Barber




I asked if anybody knew clever tricks to avoid passing
the same paramters over and over and over.

Allen reminded me,
I had forgotten about the syntax of system/words/varname.

Thanks, Allen K!

===

Just for an experiment, I made a copy of the source file in question
and used that to butcher it about a bit until I had some interesting results.

I am creating several functions, one for each of the 7 tenses in Irish.
Each does similar things and calls similar functions to change
the root word until it is fully conjugated.

I noticed that when I had condensed it down earlier, I had gotten to
a bunch of lines that looked like this:

somethinga result
somethingb result
if firstperson? somethingc result

etc.

So, I went back and I looked real hard at the alternatives.
I wanted the Rebol code to look as much like english as possible,
in the sense that the routine for each tense would be able to
be followed by someone interested in the Irish rather than
in programming, it should look almost like a (normal-)human readable set of
steps for conjugating any tense of an irish verb.

I was willing to hide the complexity in some functions,
as long as each function was ultimately a simple idea that
the language user would recognize.
e.g. "lenition" is a process that in modern standard adds an  'h' after
allowable consonants.  So I hide the testing of lenitable? and
so forth and just show Lenite Result.  e.g. ball lenited becomes bhall.

Well, I wanted to get rid of "result", and the only way I could figure it out
was to just make the darn thing global, now called "conj".
 Then I found that wasn't so bad
after all!  the code was a lot shorter and cleaner.  There was only
one place where you could effectively cheat and get the result
from calling another tense, and I figured I could deal with that if I had to,
by saving the 'person and restoring after the call.

It worked extremely well.  The seven main tense functions and the assorted
helpers now just use a bloody global variable, and the thing is ridiculously
simplified.  In the same spirit, the 'person doesn't change during a run
of the conjugation, so I made it also global and used by the main 7
and their helpers.   I basically had originally had 3 parameters and 2 local
variables defined at the head of each main function before.  Now there are none.
I used to have some lines of subtle tricks at the top of each of the 7 main and
a return line at the bottom, which certainly would distract the non-technical
person, so I yanked them out, too.

To make a long story shorter, I basically scrapped all the usual way of
paramaterizing
everything - and felt like I was doing "non-functional" programming, almost.
Back to my earliest days of basic without sub routines or parameters, almost.

I thought that the code would be a mess, but in fact it's shorter and more
comprehensible both to myself and to anyone else now.  Weird.

And although I now have to be careful about calling it recursively
and be more careful about stepping on the global value, it seems
like it may be worth it.  I am never really going to call these functions
recursively in a serious fashion.  I have one case where the Imperative
is constructed by calling other tenses, but it only goes one level deeper
and comes back.  There's no indefinite levels of recursion or anything like
that.

I feel like I am regressing here.  Anybody seen GOTO lately?

In fact, if it were possible to write a source code analyzer that could
warn you of potential problems, you might be able to let it tell
about the few issues there really are with clobbered variables
and fix them, rather than adopting the typical generic approach which is so
wasteful
of the programmer's and the computer's time.

I will include just one of the tenses here for comparison:

"sinn" means "we" in Irish
"fear" stands for the autonomous case, like in english "something was done" by
who?, not specified
"áil" is a special ending to be dealt with, and so is "éigh"

= original, before tried to condense it 

FutureTense: func [
 root[string!]
 person  [integer!]
 plural? [logic!]
 /local
 result
][

 result: lowercase copy root

 if matchtail result "áil"
  [remove skip tail result -2]

 if matchtail result "éigh"
  [remove/part skip tail result -2 2]

 append result "f"

 either (= 1 person) and (plural?) [
  if broadending? result [broaden result]
  append result "imid"
  ;-- handle 2nd Conj.
  replace result "ighf" "eó"
  replace result "aeó" "ó"
 ][
  either <> 0 person [
   if broadending? result [broaden result]
   append result reduce ["idh " make-person person plural?]
   ;-- handle 2nd Conj.
   replace result "ighf" "eó"
   replace result "aeó" "ó"
  ][
   if narrowending? result [narrow result]
   append result "ar"
   ;-- handle 2nd Conj.
   replace result "ighfe" "eóf"
   replace result "aeó" "ó"
  ]
 ]

 return result
]



=  before, after I had already worked alot to condense it 

FutureTense:

[REBOL] Andrew, you beast! - GC too tidy? Re:

2000-06-15 Thread bhandley

Nicely described Galt :)

> I suppose it means you
> can bind a block to another block or word
> and it will share the context of that other
> block.  I wonder what would happen if you
> unset O at this point.  Could you still
> run Dialect and have it bind and reduce another block
> to what O was bound to?

Tried it, yup it will and it won't work.

It will for a bit until the garbage collector takes away O.

Try

Create O as in the example.

Dialect [f1 f2] ; --Ok
Unset 'O ; -- oh oh , could be trouble coming

Dialect [f1 f2] ; --Still worksPhew.

Recycle;
Dialect [f1 f2] ; * Crash * -- Looks like the GC was a bit enthusiastic.





[REBOL] pseudo-globals? Re:(2)

2000-06-15 Thread Galt_Barber




Thanks, Thomas J, I am looking over your globalizer code now!!





[REBOL] Resume getting a web page? Re:

2000-06-15 Thread kevin

Hi Donald,

> Is there a way to resume getting a web page if, for some reason, not all of it
> is acquired on the first try?

Sterling posted to this list on Monday that some (experimental) 
patches that do what you want had been posted to:
   http://www.rebol.org/unsupported/

Check those out and see if they do what you're looking for.

Cheers,
Kev


Kevin McKinnon, Network Engineer [EMAIL PROTECTED]
Sunshine Communications http://www.sunshinecable.com

PGP Public Key: http://www.dockmaster.net/pgp.html   PGP 6.0 www.pgp.com




[REBOL] pseudo-globals? Re:

2000-06-15 Thread allenk


- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 16, 2000 4:33 AM
Subject: [REBOL] pseudo-globals?

Hi Galt,

Not sure whether this helps or not. 
But it might give you some ideas..

REBOL []
result: "This is global"

somefunc: func [/local result][
result: "This is local"

x result
y system/words/result
z
]

x: func [result][print result]
y: func [result][print result]
z: func [][print result]

>> somefunc
This is local
This is global
This is global


Cheers,

Allen K





[REBOL] Re: pseudo-globals?

2000-06-15 Thread rebol

Hello [EMAIL PROTECTED],

Is something like this what you had in mind ?

REBOL [
Title:  "Globalizer"
Author: "Thomas Jensen"
email:  [EMAIL PROTECTED]
File:   %globalizer.r
Date:   15-Jun-2000
]

; make sure we're not fooled by previous runs :-)
unset [local-var x y test-scope globalize]


; make a scope or context (ie. object!)
test-scope: make object! [
local-var: 3

x: func [num] [num + local-var]
y: func [num] [num - local-var]
]


; the funny function
globalize: func [
{Export the words in an object! to the global context, while keeping their binding}
o [object!] "Object to globalize"
/except "Exclude some words from beeing exported"
except-words [block!] "Don't globalize these words"
] [
if none? except-words [except-words: []]
foreach word (next first o) [
if not found? find except-words word [
set (in system/words word) (get in o word)
]
]
]

; now "globalize" the test-scope object, except 'local-var
globalize/except test-scope [local-var]

; 'x and 'y are now globally visible

print x 5   ; should print 8
print y 5   ; should print 2

; now change the value of 'local-var in the test context
test-scope/local-var: 5

print x 5   ; should print 10
print y 5   ; should print 0
print value ; should generate and error




; --- end of script ---

Best regards
Thomas Jensen


On 15-Jun-00, [EMAIL PROTECTED] wrote:

> 
> 
> 
> I have some routines where it references the same
> string over and over and over.
> 
> e.g.
> 
> somefunc:  func [
>   someparam [string!]
>   /local
>   result  ;  [string!]
> ][
> x result
> y result
> z result
> append result "Blah"
> { etc. ad nauseum }
> 
> return result
> 
> ]
> 
> And I noticed that I was using "result" as the first parameter
> passed to nearly everything.
> 
> Well, your first thought is that maybe you ought to make
> result just be a global variable.  But not only does it
> go against one's training and experience, but
> in fact I actually have a case where somefunc calls somefunc2,
> a routine that does something similar, and that would mess
> me up.
> 
> So, how do I have a sort of almost global variable in the sense that
> I can set it and then have all these functions know about it without
> having to pass the darn value all around to everyone of them?
> It gets tedious and one hopes that an advanced language
> like Rebol might have some tricks to cure this ailment.
> 
> It reminds me a little bit of execution-scope?  where the scope
> is defined by the block where it is first defined (or  redefined)
> and then any funcs called after that see the var bound to the
> new value, but then when the original block that had redefined
> it goes out of scope then the older original value is restored
> automatically.
> 
> Can some clever use be made of bind and objects in some way?
> Can new instances of the functions be made and the words
> in the procedure bound to them?
> e.g. bind x,y,z to this "result", or bind copies of them?
> 
> I thought already about creating an object which has a layer like
> this:
> 
> r: make object! [
> parm1: result
> xx: x parm1
> yy: y parm1
> zz: z parm 1
> aappend: func[ str] [append parm1 str]
> ]
> 
> and then going like this
> r
> r/xx
> r/yy
> r/zz
> r/aappend "stuff"
> 
> but then I thought that it's only slightly better, and still not ideal.
> what would be really cool is a way to bind x, y, and z
> so that I don't need any extra clutter, so my code would just be
> x
> y
> z
> append "stuff"
> 
> and all these operations would happen on "result"
> 
> Does anybody have any idea what the heck I am trying to get at?
> I hate seeing oodles of functions where the same stupid parameter
> is passed over and over and over and over up and down thru the
> various levels, never changing, just getting passed again and again and again,
> and sometimes not just one but several.  Ick.  This situation must
> be very common.
> 
> When we speak in human languages, we
> often introduce a subject or topic and then it's understood
> that we are referring to that until we say otherwise.
> Computers are very precise, but only through tedious programmer
> effort.  The obvious stuff shouldn't have to be said, said, said, said.
> 
> ?
> 
> -galt
> 
> 
> 




[REBOL] Resume getting a web page?

2000-06-15 Thread ddalley


Is there a way to resume getting a web page if, for some reason, not all of it
is acquired on the first try?

There is a large page that I am trying to get, but only half of it arrives -
all of my browsers fail to get all of it, too, so it's not just REBOL that has
a problem.

IF ERROR? TRY would restart from the beginning and, with a 1Mb page size, that
is not desirable if other solutions exist. If I could continue from the break
point, that would be handy.

-- 

---===///||| Donald Dalley |||\\\===---
 The World of AmiBroker Support
  http://webhome.idirect.com/~ddalley
  UIN/ICQ#: 65203020




[REBOL] Re: CGI and /view

2000-06-15 Thread kolla

On Wed, 14 Jun 2000 [EMAIL PROTECTED] wrote:

> Hello all,
> 
> On my setup (NT and Apache), I only succeeded to use /Core for CGI.
> Not /View.
> 
> In my rebol headers,
> 
> #!c:/rebol/rebol.exe -cs would work.
> 
> #!c:/rebol/view/rebol.exe -cs won't work. After executing the script
> from my web browser, it just waits indefinetely...

Pining for $DISPLAY perhaps? :)


-- kolla




[REBOL] Andrew, you beast!

2000-06-15 Thread Galt_Barber




REBOL [
Title: "Andrew, you beast!"
File: %test3.r
]

rf: func [
][
 do %test3.r
]

O: make object! [
f1: func [] [print "F1."]
f2: func [] [print "F2."]
set 'Dialect func [blk [block!]] [reduce bind blk 'f1]
print
{
Amazingly, you can put any code in the object and the darn stuff
will just get executed when the object is creation code is executed.
Otherwise you wouldn't be seeing this message now.
Of course when you create an object by simple cloning
of another object you probably don't get this
execution side-effect.

Notice how Andrew had previously named blk
as Dialect, which was certainly confusing
but as far as I could tell didn't add to
the understanding.

However, he has to use "set 'Dialect"
instead of simply having  "Dialect:"
because he doesn't want Dialect hanging
around as another element (method) of the object,
but in fact wants Dialect to be a global critter
accessible outside the object later.

Notice that because
F1 and F2 are functions they will be
automatically executed when they are reduced.

What all this has to do with dialects exactly is
still abit unclear.  I suppose it means you
can bind a block to another block or word
and it will share the context of that other
block.  I wonder what would happen if you
unset O at this point.  Could you still
run Dialect and have it bind and reduce another block
to what O was bound to?
}
]

;--  just a side-track

OO: make O []   ;-- notice you dont see all that text repeated again now.

unset 'OO;-- just to keep it from being a distraction

;--  the main enchilada   (anyone hungry?)

B: [f1 f2 f1]

Dialect B

print "-"

;--  more derring do

unset 'O

C: [f1 f2 f2 f1]

Dialect C;-- that ol' abracadabra still has some magic left in it.

halt





[REBOL] CGI Re:(4)

2000-06-15 Thread tbrownell

Perhaps also related to my "Rebol on IIS not sending
email when commanded to via cgi." (Although I have no
problem writing to files.)

TBrownell

--- [EMAIL PROTECTED] wrote:
> 
> - Original Message - 
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, June 15, 2000 3:45 AM
> Subject: [REBOL] CGI Re:(2)
> 
> 
> > 
> > 
> >Howdy, Daniel: 
> > 
> > > Thank you for your help, everyone.
> > > 
> > > This is how far I've got until now :
> > > 
> > > Apparently,  file access is   working normally
> only in  the
> > > first  cgi script launchedby   Apache, all
> itschild
> > > processes (subsequent calls of scripts, whether
> they reside
> > > in cgi-bin or elsewhere) have  problems to
> access the local
> > > file system.
> > 
> >   That's an odd one.  We'll have a closer look at
> that one
> >   when we can (cgi with apache for windows,
> right?), but
> >   unfortunately don't have a decent answer for why
> you're
> >   seeing that behavior right now.
> > 
> >   Is having your cgi-bin script reading and
> writing files
> >   outside of cgi-bin what you want to accomplish?
> > 
> >   Perhaps you could have a separate rebol process
> running
> >   living in the directory that you want to write
> files in that
> >   talks through ports to the cgi-bin program. This
> background
> >   REBOL process could do the writing and reading
> of files on
> >   the cgi-bin script's behalf.
> > 
> >   -jeff
> >  
> >
> Hey Jeff,
> 
> This might be related to the do/args "string" bug I
> found, feedback #3246.
> 
> Cheers,
> 
> Allen K
> 
> 
> 
> 
> 
>  
> > 
> 


__
Do You Yahoo!?
Yahoo! Photos -- now, 100 FREE prints!
http://photos.yahoo.com




[REBOL] pseudo-globals?

2000-06-15 Thread Galt_Barber




I have some routines where it references the same
string over and over and over.

e.g.

somefunc:  func [
   someparam [string!]
   /local
   result  ;  [string!]
][
 x result
 y result
 z result
 append result "Blah"
 { etc. ad nauseum }

 return result

]

And I noticed that I was using "result" as the first parameter
passed to nearly everything.

Well, your first thought is that maybe you ought to make
result just be a global variable.  But not only does it
go against one's training and experience, but
in fact I actually have a case where somefunc calls somefunc2,
a routine that does something similar, and that would mess
me up.

So, how do I have a sort of almost global variable in the sense that
I can set it and then have all these functions know about it without
having to pass the darn value all around to everyone of them?
It gets tedious and one hopes that an advanced language
like Rebol might have some tricks to cure this ailment.

It reminds me a little bit of execution-scope?  where the scope
is defined by the block where it is first defined (or  redefined)
and then any funcs called after that see the var bound to the
new value, but then when the original block that had redefined
it goes out of scope then the older original value is restored
automatically.

Can some clever use be made of bind and objects in some way?
Can new instances of the functions be made and the words
in the procedure bound to them?
e.g. bind x,y,z to this "result", or bind copies of them?

I thought already about creating an object which has a layer like
this:

r: make object! [
 parm1: result
 xx: x parm1
 yy: y parm1
 zz: z parm 1
 aappend: func[ str] [append parm1 str]
]

and then going like this
r
r/xx
r/yy
r/zz
r/aappend "stuff"

but then I thought that it's only slightly better, and still not ideal.
what would be really cool is a way to bind x, y, and z
so that I don't need any extra clutter, so my code would just be
x
y
z
append "stuff"

and all these operations would happen on "result"

Does anybody have any idea what the heck I am trying to get at?
I hate seeing oodles of functions where the same stupid parameter
is passed over and over and over and over up and down thru the
various levels, never changing, just getting passed again and again and again,
and sometimes not just one but several.  Ick.  This situation must
be very common.

When we speak in human languages, we
often introduce a subject or topic and then it's understood
that we are referring to that until we say otherwise.
Computers are very precise, but only through tedious programmer
effort.  The obvious stuff shouldn't have to be said, said, said, said.

?

-galt





[REBOL] REBOL CGI on Netscape Web Server

2000-06-15 Thread tim

Hi: I'm looking for instructions on how to configure
Netscape Web Server for Rebol CGI scripts. Does any
one have this info or can point me to documentation.
Thanks
Tim
P.S. Running on NT 4.0 Server




[REBOL] No longer dangerous (use of) Secure Re:(3)

2000-06-15 Thread jeff



   Howdy, Ladislav:

   You really ought to write up a little explanatory
   article for that, how you created a separate execution
   context for the untrusted code, why you needed to do a
   double bind, etc.

   In briefly studying your script, I didn't spot any real
   dangers of the untrusted script being able to escape
   its secure context and modify the top level context.
   If there is that sort of danger what is it?

   One principle "danger" involved with executing
   arbitrary REBOL code is that an untrusted script might
   never finish executing.  While not dangerous to your
   files or the security of your computer, this could be
   an annoying drain of CPU cycles. Of course, the way
   security works now, a human operator has to okay
   lowering security transitions so that same person can
   hit escape if the untrusted script seems to be
   endlessly looping. :-) For non-interactive setups, you
   could write a file before doing a script and remove it
   when the script is done. A watching process may
   shutdown and restart the REBOL process if it sees that
   the timestamp on the "I'm going to do a script" file is
   older than a certain predetermined age. 

   Moral of the story?  There are always inherent risks in
   arbitrarily executing random code. Careful
   consideration has to be given to the full range of
   possibilities.  We're very security minded here at
   REBOL Tech. as rock solid security is a prerequisite
   for successful distributed computing-- and these kinds
   of questions are guiding the evolution of REBOL's
   security model.

   As it stands today, you can build REBOL scripts that
   can inspect arbitrary REBOL code, and scripts that can
   DO untrusted code.  Just turn on all the security and
   never try and lower it again.

   secure [file throw net throw] 

   With all the sheilds raised you can DO whatever walks
   through the door with out any fear of it resulting in
   harm to your system.

   Non-interactively (cgi, shell, etc), raise the sheilds,
   DO the script, end of program (script gets respawned
   later) -- any impact the script could have on your
   execution environment will be wiped from memory, so
   it's no bother.

   -jeff

 
> If you got here, I have got a  problem for you: the present
> code is still dangerous. Could  you find why and suggest  a
> solution?
> 
>  {8^D Ladislav




[REBOL] buffering Re:

2000-06-15 Thread Petr . Krenzelok



[EMAIL PROTECTED] wrote:

> I noticed today that doing the following
>
> write %file read http://foo.com/bar/baz
>
> has the unfortunate result of (apparently) double buffering the entire
> contents of baz in memory during the whole process.  Big problem if
> you're fetching, as I was, a massive file...
>
> Is there some other mechanism for doing this that would in essence
> stream the bits from pipe to disk w/o buffering the whole thing even
> once, much less twice?

Maybe following Bohdan's script could inspire you? :-)

http://www.rebol.org/file/movefile.r

Cheers,
-pekr-

>
>
> jb




[REBOL] buffering

2000-06-15 Thread jbone


I noticed today that doing the following

write %file read http://foo.com/bar/baz

has the unfortunate result of (apparently) double buffering the entire
contents of baz in memory during the whole process.  Big problem if
you're fetching, as I was, a massive file...

Is there some other mechanism for doing this that would in essence
stream the bits from pipe to disk w/o buffering the whole thing even
once, much less twice?

jb





[REBOL] Problems calling 'external' functions Re:

2000-06-15 Thread icimjs

Hi Peter,

I have not encountered a problem with multiple do's. I don't see why there
should be a problem.

If your functions in test_opcodes.r evaluates anything that ultimately
attempts to evaluate words defined in ea.r, then you would be getting an
error message, if ea.r had not been do'ne.

My guess is your problem has nothing to do with 'do.

Send me your files off list and - quite likely - I'll have a solution for
you soon.

mailto: [EMAIL PROTECTED]

At 04:45 PM 6/15/00 +0200, you wrote:
>Hello!
>
>A couple of weeks ago I asked how to split a
>project in to several files. The solution was
>to 'do' all files to include them in the
>main file.
>
>This has worked fine until now...
>
>I now have created some files like:
>
>opcodes.r  (includes a 'do %ea.r')
>ea.r
>test_opcodes.r (includes a 'do %opcodes.r')
>test_ea.r  (includes a 'do %ea.r')
>
>In the test_* files I have prepared test cases
>to verify the functions in the other files.
>
>Executing the test_ea.r file is working fine and
>will call all functions in ea.r without problems
>but when I execute test_opcodes.r it does not
>execute the functions in ea.r. There are no error
>messages saying that no function by that name
>is found.
>
>Is there some sort of limit to how 'deep' a
>function call could be?
>
>I have tried to include a 'do %ea.r' in the
>test_opcodes.r as well but nothing changes.
>
>Could someone please help me?
>
>Best regards,
>Peter Carlsson
>
>
>Peter CarlssonTel: +46 31 735 45 26
>Saab Ericsson Space ABFax: +46 31 735 40 00
>S-405 15 Göteborg Email: [EMAIL PROTECTED]
>SWEDENURL: http://www.space.se
>
>
>
>

;- Elan [ : - ) ]




[REBOL] REBOL and the unix shell Re:(4)

2000-06-15 Thread chaz

Here's a prototype that Ted Husted was working on at one time. I wonder
what happened. http://husted.com/rebol-dev/home.html

At 01:52 PM 6/14/00 -0500, you wrote:
>Hey, combine these articles with the script library, online documentation, 
>news headlines, links, discussion board, a REBOL store (hey, who doesn't 
>want a t-shirt, anyway?) and an open-source project area and you have a 
>very cool resource.
>
>8-)
>
>>My real hope is that if I get a bunch of these articles
>>together, other people would be interested in
>>contributing some domain specific articles of their own
>>to the collection.  REBOL is used for a universe of
>>tasks, and various people out there know the complete
>>ins and outs of doing a particular task with REBOL.
>>IMHO, their specialized REBOL knowledge should be
>>recorded and shared with the rest of the community.
>
>
>




[REBOL] test

2000-06-15 Thread jregent



Objevujte Internet s http://www.centrum.cz
Založte si svuj mail na http://mail.centrum.cz




[REBOL] Problems calling 'external' functions

2000-06-15 Thread peter . carlsson

Hello!

A couple of weeks ago I asked how to split a
project in to several files. The solution was
to 'do' all files to include them in the
main file.

This has worked fine until now...

I now have created some files like:

opcodes.r  (includes a 'do %ea.r')
ea.r
test_opcodes.r (includes a 'do %opcodes.r')
test_ea.r  (includes a 'do %ea.r')

In the test_* files I have prepared test cases
to verify the functions in the other files.

Executing the test_ea.r file is working fine and
will call all functions in ea.r without problems
but when I execute test_opcodes.r it does not
execute the functions in ea.r. There are no error
messages saying that no function by that name
is found.

Is there some sort of limit to how 'deep' a
function call could be?

I have tried to include a 'do %ea.r' in the
test_opcodes.r as well but nothing changes.

Could someone please help me?

Best regards,
Peter Carlsson


Peter CarlssonTel: +46 31 735 45 26
Saab Ericsson Space ABFax: +46 31 735 40 00
S-405 15 Göteborg Email: [EMAIL PROTECTED]
SWEDENURL: http://www.space.se





[REBOL] How and when is bind useful? Re:(2)

2000-06-15 Thread bhandley

Thanks Andrew. On the second read. I realised it is exactly what I need my
current programming excerise: a dialect for a specific device control app.

Thanks Petr. Your example looks so devilishly clever I think I'll go to be
and read it in the moring. :)
Brett.




[REBOL] How and when is bind useful? Re:

2000-06-15 Thread Petr . Krenzelok



[EMAIL PROTECTED] wrote:

> It takes me awhile sometimes...
> But can someone give me an example of how bind is useful please?

One real life example. One of our older report generators produced some
reports and my boss wanted to get it into Lotus 1-2-3 (equivalent of
Excel). I was asked for removal of unwanted lines (column headers, etc.)
So I created following script on the fly directly in console and than
decided to abstract it a little bit and save for later usage:

REBOL []

; remove unwanted portions of text file

file: read/lines %some-file.txt
result: copy []

what-not: [
empty? trim/all copy line
found? find trim/all copy line "WEIGHTNAMEOFPRODUCT"
found? find radek "==="
(to-char first radek) = (to-char 12)
]

foreach line file [if not any bind what-not 'line [insert tail result
line]]

write/lines %result.txt result


'what-not contains 'line word, but can't understand it, as it has no
value assigned. We are using 'what-not block inside of foreach loop, and
we wan to "bind" 'what-not's context 'line word to that of 'foreach
loop. Or something like that :-)

-pekr-

>
>
> Thanks.
> Brett.




[REBOL] restore security

2000-06-15 Thread fsievert

Hi!

Is there already an idea how to restore security after switching to a
higher security level? Of course in a save way and without asking the
user?

Maybe something like that would be a sollution:

use [security] [
   security: secure/object throw
   == make security! [net allow file allow]

   do %whatever.r

   secure security
]

This would be save, when you are unable to create or modify security!-
Values yourself. Only secure can create a security!-Values, when it is
called with the /object refinement. When you have a security!-Value, you
can lower security to that security level.

Good idea or not?
Frank




[REBOL] An appeal to keep /Core Re:(4)

2000-06-15 Thread kgozlin



[EMAIL PROTECTED] wrote:

> One of the things that always amazes people is how powerful /Core is
> despite how small the binary is. I think /Core needs to stay around because
> we will be looking to put messaging language into smaller and smaller
> devices and time goes by. Put /Core on a watch or in a medical device which
> swims in the bloodstream and sends messages back to a computer via
> wireless. Keep /Core around, for sure, and work to make it SMALLER for
> gosh sakes.

but core will still exists on platform without GUI.
karol





[REBOL] How and when is bind useful? Re:(2)

2000-06-15 Thread Al . Bri

Here's a better example:
>> O: make object! [
[F1: func [] [print "I'm F1"]
[F2: func [] [print "And this is F2"]
[set 'Dialect func [Dialect [block!]] [reduce bind Dialect 'F1]
[]
>> B: [F1 F2 F1]
== [F1 F2 F1]
>> Dialect B
I'm F1
And this is F2
I'm F1
== [unset unset unset]

Andrew Martin
Writing poetry on ICQ...
ICQ: 26227169
http://members.xoom.com/AndrewMartin/
-><-




[REBOL] How and when is bind useful? Re:

2000-06-15 Thread Al . Bri

Brett wrote:
> It takes me awhile sometimes...
> But can someone give me an example of how bind is useful please?

It's useful in dialects. Here's a quick example:

O: make object! [
f1: func [] []
f2: func [] []
set 'Dialect func [Dialect [block!]] [reduce bind Dialect 'f1]
]

B: [f1 f2 f1]

Dialect B

OK? :-)

Andrew Martin
Empty dialects...
ICQ: 26227169
http://members.xoom.com/AndrewMartin/
-><-




[REBOL] How and when is bind useful?

2000-06-15 Thread bhandley

It takes me awhile sometimes...
But can someone give me an example of how bind is useful please?

Thanks.
Brett.