[REBOL] Locking mechanism

2000-03-26 Thread bregolin

Hi,

is there a way to achieve locking in Rebol?
I mean, physical or advisor locking to achieve controlled access to a
resource (file, or others).
This subject is pretty much platform-dependent, however it is an
important issue when concurrent programs need to share access to common
resources.

Thanks,

Mauro



begin:vcard 
n:Bregolin;Mauro
tel;fax:+39 049 8073066
tel;work:+39 049 8073066
x-mozilla-html:TRUE
adr:;;
version:2.1
email;internet:[EMAIL PROTECTED]
end:vcard



[REBOL] String formatting

2000-03-14 Thread bregolin


The following is rather trivial... anyway:
what is the most convenient way of formatting strings in Rebol, let
say for producing suitable output, à la printf/sprintf in
C?
Thanks,
Mauro Bregolin
 

begin:vcard 
n:Bregolin;Mauro
tel;fax:+39 049 8073066
tel;work:+39 049 8073066
x-mozilla-html:TRUE
adr:;;
version:2.1
email;internet:[EMAIL PROTECTED]
end:vcard



[REBOL] Script return code Re:

2000-02-24 Thread bregolin

Maybe I wasn't clear enough, my posting was referring to situations in which one
has to "glue" together the execution of multiple scripts, not necessarily all of
them written in Rebol. A motivation could be legacy applications (if we call
"legacy" whatever is already there and we won't/can't modify/rewrite).
To give a real example, I need to integrate a number of Perl scripts with Rebol
scripts; I'm doing that via a main shell script - though this detail is not
relevant. In my case it's not a question of legacy software - I had to write
some pieces in Perl because I need to access a RDBMS, something I can't do today
in Rebol.
So the "driver" script (the high-level shell script in my case) needs to know
what's going on with the execution of the Perl and Rebol scripts. Perl poses non
problem, but with Rebol I can't use the same mechanism. Of course I can have it
worked out - I was wondering if anybody else felt my same need.
I think the matter may be considered on the level of "design principles" or, in
some sense, on the "philosophycal" side of what one expects from a programming
language...

Ciao

Mauro


[EMAIL PROTECTED] wrote:

> Mauro wrote:
> > My question of the day is: what mechanism can be used to
> (programmatically) test whether the execution of a Rebol script has been
> successful or not?
>
> >> S1: [print "This is S1" true]
> == [print "This is S1" true]
> >> do s1
> This is S1
> == true
> >> S2: [print "This is S2" false]
> == [print "This is S2" false]
> >> do s2
> This is S2
> == false
>
> >> SE: [print a string that is not in double quotes true]
> == [print a string that is not in double quotes true]
> >> either error? Result: try [do SE][print "There was an error?"][print "All
> OK!"]
> There was an error?
> >> either error? Result: try [do S2][print "There was an error?"][print "All
> OK!"]
> This is S2
> All OK!
> >> either error? Result: try [do S1][print "There was an error?"][print "All
> OK!"]
> This is S1
> All OK!
>
> I hope that helps! :-D
>
> Andrew Martin
> ICQ: 26227169
> http://members.xoom.com/AndrewMartin/
> -><-
>
> - Original Message -
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Sent: Thursday, 24 February 2000 10:31 PM
> Subject: [REBOL] Script return code
>
> First of all, thanks to everybody who promptly answered my former question
> on email attachments.
> My question of the day is: what mechanism can be used to (programmatically)
> test whether the execution of a Rebol script has been successful or not?
> If I'm right, a script has no way to return an "exit code" which would
> provide the usual mechanism found on Unix. While it is true that the script
> might output the equivalent of a return code, this works fine provided that
> the script doesn't do any other kind of output. In other words, it'd be
> suitable for batch-oriented scripts which don't write anything else on
> stdout/stderr.
> In my opinion, the formalized notion of a return code is essential,
> especially when one has to "glue" together scripts and/or applications and
> drive their execution by means of a higher-level program (e.g., a shell
> script), taking into account failures etc. The presence of the return code
> should also be transparent to the user, i.e. it shouldn't interfere with the
> execution of the script (like altering its output).
> Any idea of why such a feature hasn't been incorporated in the language?
> Concerning cross-platform portability, a solution a la exit() is as portable
> as C.
> Thanks for your help,
> Mauro


begin:vcard 
n:Bregolin;Mauro
tel;fax:+39 049 8073066
tel;work:+39 049 8073066
x-mozilla-html:TRUE
adr:;;
version:2.1
email;internet:[EMAIL PROTECTED]
end:vcard



[REBOL] Script return code

2000-02-24 Thread bregolin


First of all, thanks to everybody who promptly answered my former question
on email attachments.
My question of the day is: what mechanism can be used to (programmatically)
test whether the execution of a Rebol script has been successful or not?
If I'm right, a script has no way to return an "exit code" which would
provide the usual mechanism found on Unix. While it is true that the script
might output the equivalent of a return code, this works fine provided
that the script doesn't do any other kind of output. In other words, it'd
be suitable for batch-oriented scripts which don't write anything else
on stdout/stderr.
In my opinion, the formalized notion of a return code is essential,
especially when one has to "glue" together scripts and/or applications
and drive their execution by means of a higher-level program (e.g., a shell
script), taking into account failures etc. The presence of the return code
should also be transparent to the user, i.e. it shouldn't interfere with
the execution of the script (like altering its output).
Any idea of why such a feature hasn't been incorporated in the language?
Concerning cross-platform portability, a solution a la exit() is
as portable as C.
Thanks for your help,
Mauro
 


[REBOL] [REBOL] Multipart emails

2000-02-23 Thread bregolin

Does anybody know how (or has written something) to handle multipart email
messages? I mean things like listing, extracting attachments from a message
when reading it, or composing an email message consisting of a number of
attachments?

Thanks

Mauro