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

tables of pointers in I7?

4 views
Skip to first unread message

Cup of Joe

unread,
Nov 1, 2010, 11:24:32 PM11/1/10
to
I wish to have a column in my table which contains pointers to more
elaborate functions. The following code does what I need, but feels
like a most inelegant solution.

Every turn:
choose a random row in Table of Ingrid's Routine;
if Ingrid is visible:
say "[do entry]".

Table of Ingrid's Routine
do
"[do cleaning]"
"[do laundry]"

to say do cleaning:
say "Ingrid cleans a table.";
now the table is clean.

to say do laundry:
say "Ingrid fills the washing machine";
move clothes to washing machine.


Any suggestions for how to improve this, so that I can use the [To do
cleaning:] construct in place of [To say do cleaning:].

Andrew Plotkin

unread,
Nov 2, 2010, 12:49:06 AM11/2/10
to
Here, Cup of Joe <mobwa...@live.com> wrote:
> I wish to have a column in my table which contains pointers to more
> elaborate functions.

Take a look at chapter 21.3, "Phrases as values". You can create a
table column whose type is "phrase nothing -> nothing", and then
"apply" a value from that column.

--Z

--
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*

Cup of Joe

unread,
Nov 2, 2010, 8:52:31 AM11/2/10
to
On Nov 2, 12:49 am, Andrew Plotkin <erkyr...@eblong.com> wrote:

Every turn:
choose row 2 in Table of Ingrid's Routine;
if Ingrid is visible:
apply does entry;
continue the action.

Table of Ingrid's Routine

activities do does
value value a phrase nothing -> nothing
"Ingrid is cleaning" "[do cleaning]" booyah

to booyah (this is booyah):
say "Thanks Andrew! This is cool."

Erik Temple

unread,
Nov 2, 2010, 9:28:00 AM11/2/10
to
On Nov 2, 7:52 am, Cup of Joe <mobwar2...@live.com> wrote:
> Every turn:
>         choose row 2 in Table of Ingrid's Routine;
>         if Ingrid is visible:
>                         apply does entry;
>         continue the action.
>
> Table of Ingrid's Routine
> activities      do      does
> value   value   a phrase nothing -> nothing
> "Ingrid is cleaning"  "[do cleaning]"       booyah
>
> to booyah (this is booyah):
>         say "Thanks Andrew!  This is cool."

Just to take advantage of the presence of this thread to ask about
something that I've been trying to do: Is there any way to do
something similar with descriptions? I've tried storing a description
of objects in both tables and lists, but Inform refuses to compile,
with the message that indicates that this kind of value cannot be
stored in a table.

Basically, I want to use the table to store a description of things
that should be iterated over--rooms, visible things, touchable things,
etc--and then execute that description elsewhere.

--Erik

0 new messages