Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

I7 Still have indenting problems:

0 views
Skip to first unread message

Al

unread,
Dec 24, 2009, 1:19:34 PM12/24/09
to
Why I can't get the IDE to indent properly is anyone's guess ! ! !

The "after opening a closed container" code block is still messing
up:

Where am I going wrong?

<code>

to say /l: say line break.


Starter is a room.

a closed openable container called a box is in Starter.
the box is fixed in place.

a ball, a bat, a wooden block, a steel rod, a plastic thingy,
and a paper boat are in the box.

definition: a container is empty if the number of things in it is 0.

after opening a closed container:
if the noun is empty begin;
say "[The noun] is empty.";
otherwise;
say "You have opened the [noun].[/l]Inside [the noun] you see the
following: [/l]";
repeat with item running through things inside the noun:
say "a [item][/l]";
end if.

instead of searching an open container:
say "Inside [the noun] you see the following: [/l]";
repeat with z running through things in the noun:
say "a [z][/l]";

<code>

Jim Aikin

unread,
Dec 24, 2009, 2:36:24 PM12/24/09
to
On 12/24/2009 10:19 AM, Al wrote:
> Why I can't get the IDE to indent properly is anyone's guess ! ! !

...but you're using "begin;" syntax. The indentations are entirely
irrelevant.

> The "after opening a closed container" code block is still messing
> up:
>
> Where am I going wrong?

Well, for one thing, if you're using "repeat" in a block that includes
"begin;" you need to use "repeat begin;" and "end repeat". It took me a
couple of minutes to sort this out, because I always use
colon-and-indentation, but the following compiles:

after opening a closed container:
if the noun is empty begin;
say "[The noun] is empty.";
otherwise;
say "You have opened the [noun].[/l]Inside [the noun] you see the
following: [/l]";

repeat with item running through things inside the noun begin;
say "a [item][/l]";
end repeat;
end if.

instead of searching an open container:
say "Inside [the noun] you see the following: [/l]";

repeat with z running through things in the noun begin;
say "a [z][/l]";
end repeat.

--JA

Jim Aikin

unread,
Dec 24, 2009, 2:42:03 PM12/24/09
to
On 12/24/2009 10:19 AM, Al wrote:
> Why I can't get the IDE to indent properly is anyone's guess ! ! !

...but you're using "begin;" syntax. The indentations are entirely
irrelevant.

> The "after opening a closed container" code block is still messing


> up:
>
> Where am I going wrong?

Well, for one thing, if you're using "repeat" in a block that includes

"begin;" you need to use "repeat begin;" and "end repeat". It took me a
couple of minutes to sort this out, because I always use
colon-and-indentation, but the following compiles:

after opening a closed container:


if the noun is empty begin;
say "[The noun] is empty.";
otherwise;
say "You have opened the [noun].[/l]Inside [the noun] you see the
following: [/l]";

repeat with item running through things inside the noun begin;
say "a [item][/l]";
end repeat;
end if.

instead of searching an open container:
say "Inside [the noun] you see the following: [/l]";

repeat with z running through things in the noun begin;
say "a [z][/l]";
end repeat.

--JA

>

Al

unread,
Dec 24, 2009, 2:50:45 PM12/24/09
to
On Dec 24, 12:42 pm, Jim Aikin <midigur...@gmail.com> wrote:

> Well, for one thing, if you're using "repeat" in a block that includes
> "begin;" you need to use "repeat begin;" and "end repeat". It took me a
> couple of minutes to sort this out, because I always use
> colon-and-indentation, but the following compiles:

(SNIP)


Thanks much. Maybe the I7 Manual needs to be corrected in order to
reflect this.

It currently does NOT do that at this time. Correct me if need be.


vaporware

unread,
Dec 24, 2009, 4:35:58 PM12/24/09
to

The error message is pretty clear about it:

"Problem. The rule or phrase definition 'after opening a closed
container' seems to use both ways of grouping phrases together into
'if', 'repeat' and 'while' blocks at once. Inform allows two
alternative forms, but they cannot be mixed in the same definition.

One way is to end the 'if', 'repeat' or 'while' phrases with a
'begin', and then to match that with an 'end if' or similar.
('Otherwise' or 'otherwise if' clauses are phrases like any other, and
end with semicolons in this case.) You use this begin/end form here,
for instance - 'if the noun is empty begin' .

The other way is to end with a colon ':' and then indent the
subsequent phrases underneath, using tabs. (Note that any 'otherwise'
or 'otherwise if' clauses also have to end with colons in this case.)
You use this indented form here - 'repeat with item running through
things inside the noun' ."

vw

0 new messages