[REBOL] Re: help with mail attachment please
From: holger:rebol at: 14-Aug-2001 9:59
On Fri, Aug 10, 2001 at 10:51:26AM -0600, David Kachel wrote:
> I think you may have missed my point:
> Can View (or CORE for that matter) be launched from anything on a Mac and
> passed parameters? In other words, can any software OTHER THAN REBOL OR A
> WEB SERVER, activate and pass a function name along with parameters to
> Rebol, on which information Rebol can then act? Or is Rebol simply a lump
> that requires me to physically launch it with a mouse and input calls
> from the keyboard?
>
> <RANT ON>
> As I understand it, Rebol easily responds to such 'messaging' on any
> flavor of Unix, and even on, ugh, Windblows(?). Why on Earth is it
> considered unimportant to do the same on a Mac?
REBOL does not "respond to messaging" in order to process parameters.
Unix, Windows, AmigaOS, BeOS etc. all support industry-standard program
arguments (argc, argv), passed to the program when it is started, and those
are parsed and interpreted by REBOL. Unfortunately MacOS does not support
this, but requires proprietary methods for that (AppleScript, I assume).
REBOL/View on Mac DOES support opening a script with OpenDocEvent (basically
clicking on a script icon, causing View to be start and execute the script),
but this does not help in passing arguments, because MacOS does not appear
to support anything resembling "command lines".
> It's not as if such implementation would be difficult either! Only four
> commands would be required:
No, it is more complicated than that. Part of the problem is that MacOS
does not allow multiple instances of an application to run simultaneously,
i.e. unlike all other operating systems it does not support a model in
which an application is started with certain arguments such as a script
name, does its work, and then quits, and multiple such instances can run
in parallel.
Instead MacOS forces an application to multiplex internally, based on "document"
handles. This may be fine for GUI-heavy applications which sit in an event
loop most of the time, but it is a big problem for applications which are
primarily "processors" (e.g. interpreters) and have an inherently stateful
execution model. This is why REBOL/View on Mac clones itself during
installation, allowing multiple instances of REBOL to run at the same time,
as different binaries. Apparently this is the only "solution" to this problem
on MacOS.
> Now in theory, I could presumably have the web server call Rebol first,
> which could then successfully package and send my email. But the next
> thing Rebol would have to do is call the aforementioned cgi, which of
> course it cannot do, because Rebol is 99% mute!!!
The next problem is that MacOS, unlike Unix, Windows, AmigaOS, BeOS,...
apparently has no system() call (or anything similar), i.e. does not
allow interaction with other applications in an industry standard
fashion, but requires proprietary methods (AppleScript again, I assume).
> If I can write a shell program on Linux that calls Rebol, sends it
> parameters and makes it jump, then I should be able to do exactly the
> same thing on any other platform, including the Mac, which accomplishes
> such things through APPLESCRIPT !!!!
If MacOS HAD a shell that provides Posix-like features and API then you
COULD do it with REBOL. It is not REBOL's fault that MacOS does pretty
much all aspects of computing differently than everyone else :-).
REAL AppleScript support (along with support for other platform-specific
scripting languages, such as ARexx) is something that is on our list.
Unfortunately at the moment other things have higher priorities. Adding
to the difficulties is that currently we do not have a real Mac expert
on staff at RT.
--
Holger Kruse
[holger--rebol--com]