[comp.sys.mac.hypercard] Hypertalk syntax?

kautz@allegra.att.com (Henry Kautz) (05/02/90)

Is there a formal, complete, correct syntax for Hypertalk anywhere out
there?  BNF or something similiar?  I've found it extremely
frustrating that constructions that seem to be syntactically correct
often don't work.  For example, consider the commands "Go to" and
"Edit script".  The argument of each is a "target".  So why are
	Go to first card of stack "Foobar"
	Edit script of stack "Foobar"
	Edit script of first card
perfectly acceptable, while
	Edit script of first card of stack "Foobar"
is not?  

(Or is the horrible truth that Hypertalk doesn't really have a syntax,
and the compiler is really just a random mess of spaghetti code???)
--
	
---- Henry Kautz

:uucp:		allegra!kautz		
:arpa/internet: kautz@allegra.att.com
	or	kautz@research.att.com
:csnet: 	kautz%research.att.com@RELAY.CS.NET
:old csnet:	kautz%allegra@btl.csnet

hmarvel@hpuxa.ircc.ohio-state.edu (Howard P. Marvel) (05/02/90)

In article <KAUTZ.90May2095132@tzero.allegra.att.com> kautz@allegra.att.com writes:
>Is there a formal, complete, correct syntax for Hypertalk anywhere out
>there?  
Try "HyperCard Script Language Guide:  The HyperTalk Language," published
by Addison-Wesley


>	Edit script of first card of stack "Foobar"
doesn't work.  To quote the above-cited book, "You cannot refer to an object
directly within another stack. You have to go to the stack before you can
address it objects directly"  (p. 40)
>
>(Or is the horrible truth that Hypertalk doesn't really have a syntax,

Apparently not.

>and the compiler is really just a random mess of spaghetti code???)

What compiler?
>	
>---- Henry Kautz

jk3t+@andrew.cmu.edu (Jonathan King) (05/03/90)

hmarvel@hpuxa.ircc.ohio-state.edu (Howard P. Marvel) writes:
> In article <KAUTZ.90May2095132@tzero.allegra.att.com> kautz@allegra.att.com wr\
> ites:
> >Is there a formal, complete, correct syntax for Hypertalk anywhere out
> >there?  
> Try "HyperCard Script Language Guide:  The HyperTalk Language," published
> by Addison-Wesley

Yes, this is the book.  Full title is "*Apple* Hypercard Script
Language Guide:  The Hypertalk Language".  Published in 1988, ISBN
0-201-17632-7.

> >       Edit script of first card of stack "Foobar"
> doesn't work.  To quote the above-cited book, "You cannot refer to an object
> directly within another stack. You have to go to the stack before you can
> address it objects directly"  (p. 40)

Actually, this isn't quite right.  You *can* say:

Edit script of stack "Foobar"

(at least in version 1.2).  But you can't say:

Edit script of ("Stack Foobar")

even though the description of the command "Edit script" on page 105
of the HSLG says that the object edited can be expressed as a factor,
and page 49 states that a factor can be an expression enclosed in parentheses.

Note that the hypertalk, um, phrase 'first card of stack "Foobar"' is
not a factor, but an expression.  But the obvious work-around of
saying:

Edit script of (first card of stack "Foobar")

doesn't work.  It looks like Hypercard contains an undocumented
feature which disallows the use of parentheses to "factorize" the
description of the object you wish to edit.  This isn't too much fun.

>---- Henry Kautz

jking  (eagerly awaiting the forthcoming caffeine manager docs)

jdevoto@Apple.COM (Jeanne A. E. DeVoto) (05/03/90)

In article <KAUTZ.90May2095132@tzero.allegra.att.com>
kautz@allegra.att.com writes:
>Is there a formal, complete, correct syntax for Hypertalk anywhere out
>there?  BNF or something similiar?

There's no BNF; I don't think it's possible to write a BNF for HyperTalk.
The most complete and correct language reference I know of is the 
Addison-Wesley text that a couple of others have mentioned.

> [...]  For example, consider the commands "Go to" and
>"Edit script".  The argument of each is a "target".  So why are
>	Go to first card of stack "Foobar"
>	Edit script of stack "Foobar"
>	Edit script of first card
>perfectly acceptable, while
>	Edit script of first card of stack "Foobar"
>is not?  

The reason is that object within a stack other than the current one
aren't directly accessible. You can't make direct references to cards,
backgrounds, buttons or fields in stacks other than the one you're
in without going to that stack. In other words, stacks that are not
currently open are "black boxes" as far as HyperTalk is concerned.
You can refer to *stack* properties from other stacks, but not to
properties of objects within the stack. (Exception: you can say "go
card foo of stack bar".)

>(Or is the horrible truth that Hypertalk doesn't really have a syntax,
>and the compiler is really just a random mess of spaghetti code???)

(MOO-ha-ha-ha-ha!!!!!)
-- 
========= jeanne a. e. devoto ========================================
 jdevoto@apple.com     |  You may not distribute this article under a
 jdevoto@well.sf.ca.us |  compilation copyright without my permission.
______________________________________________________________________
 Apple Computer and I are not authorized      |        CI$: 72411,165
 to speak for each other.                     |  AppleLink: SQA.TEST