On Fri, 28 May 1999, DeRobertis <[EMAIL PROTECTED]>:
>
> At 11:40 AM -0600 on 5/27/99, Scott Raney wrote:
>
> >I understand the problem (I think it's called "greedy matching"), but
> >since all other regex patterns work the same way, I'm puzzled as to
> >why you think it's a problem in MetaCard but not in
> >Perl/Python/Tcl/etc? How do you get short matches in any of these
> >other languages?
>
> Scott, you ought to read the perl regexp manpage :_
I can never find those because the naming system is so screwed up (at
least on UNIX systems). But you're right, it is on that page. Where
I looked was in the O'Reilly Perl book, and it doesn't mention this
feature.
> Anyay, given the string:
>
> "Hello. This is a test. This is not a real string."
>
> /He(.*)This/
>
> will match .* to "llo. This is a test. "
>
> but
>
> /*He(.*?)This/
>
> will match .* to "llo. "
I did a little poking around and discovered that Tcl versions prior to
the current 8.1 release don't support this feature, nor does any
version of Python. Tcl 8.1 and both Perl 4 and 5 do support it,
though. I'll put it on the to-do list for MetaCard, but I'm not
thrilled by the fact that the new package Henry Spencer developed that
includes this feature is about 8 times the size as the package
MetaCard currently uses.
And from another message on the original topic:
> >Scott Raney and I have discussed include several times, but
> >besides being unable to come up with a comprehensible name ("include"
> >really says nothing, does it?),
>
> I don't see why not. It's an imperitive... It tells the compiler: "Include
> whatever [into my source]"
But *when*? When the application starts up? When the stack opens?
When that object opens? When it gets its first message? What happens
when the user edits the script with the #include? Or edits the file
(or the script of the other object) that gets included?
> >it'd be an implementation nightmare.
>
> #include is fine; it's preprocessed. I'd just read the file before passing
> the script to the frontend. Call that layer the preprocessor.
So it's when the stack gets loaded? Compiling every script in the
stack at that time could get expensive...
> >And
> >people will have problems understanding it.
>
> How about "using script file <file>". No, never mind. That sounds like it
> establishes that there is a point at which you un-use it.
The big problem is distinguishing "compile-time" operations from
"run-time" options. xTalk is different from almost all other
languages, including most other scripting languages, because there is
no "main" routine.
> Another thing, though. With the HT compiler, one could make semi-protected
> libraries for distribution.
You can do this now with MetaCard, which encrypts scripts in password
protected stacks. Decrypting them takes time compared with just
reading in a tokenized representation, though. On the other hand,
it's probably more secure: Ever seen a Java byte-code decompiler?
They're amazingly effective at recovering the original source...
Regards,
Scott
********************************************************
Scott Raney [EMAIL PROTECTED] http://www.metacard.com
MetaCard: You know, there's an easier way to do that...