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

Error message unexpected

15 views
Skip to first unread message

duke

unread,
Jan 20, 2011, 9:25:06 PM1/20/11
to
From W.H. Mitchell's slide presentation:

write("Before make_block")
text := make_block(x, y, z)
write(text[10])
write("After make_block")

The expected output according to the slides, should be:

Before make_block
After make_block

I get:

Before
make_block

Run-time error
106
File test-this.icn; Line
9
procedure or integer
expected
offending value:
&null
Traceback:
main()
&null((variable = "testing"),(variable = &null),(variable = &null))
from line 9 in test-this.icn

I'm using:

icont -V
Icon Version 9.4.3, November 14, 2005 (linux, i686.s, Mar 5 2010)

Is it because the slides were created using an older compiler?

Frank J. Lhota

unread,
Jan 21, 2011, 5:56:05 AM1/21/11
to
How is make_block defined?

--
"All things extant in this world,
Gods of Heaven, gods of Earth,
Let everything be as it should be;
Thus shall it be!"
- Magical chant from "Magical Shopping Arcade Abenobashi"

"Drizzle, Drazzle, Drozzle, Drome,
Time for this one to come home!"
- Mr. Wizard from "Tooter Turtle"

duke

unread,
Jan 21, 2011, 9:26:13 AM1/21/11
to
On Jan 21, 3:56 am, "Frank J. Lhota" <FrankLho.NOS...@rcn.com> wrote:
>
> How is make_block defined?

It isn't shown on Mitchell's slides.
Just before this example occurs, Michell writes:

Fact:
Unexpected failure is the root of madness.

So the error message seems to be the result of using an undeclared
procedure.
But why did I get an error message at runtime, with a halt in
execution, and Mitchell did not (according to his output). Unless the
procedure does need to be present, and he's referring to another
source of insanity. :)

Frank J. Lhota

unread,
Jan 21, 2011, 6:10:20 PM1/21/11
to

I suspect that make_block is a procedure or record that produces an
object with fewer than 10 components. Try adding this declaration to
your code:

record make_block(x, y, z)

duke

unread,
Jan 22, 2011, 7:31:15 PM1/22/11
to
On Jan 21, 4:10 pm, "Frank J. Lhota" <FrankLho.NOS...@rcn.com> wrote:
> On 1/21/2011 9:26 AM, duke wrote:
>
>
>
> > On Jan 21, 3:56 am, "Frank J. Lhota"<FrankLho.NOS...@rcn.com>  wrote:
>
> >> How is make_block defined?
>
> > It isn't shown on Mitchell's slides.
> > Just before this example occurs, Michell writes:
>
> > Fact:
> >      Unexpected failure is the root of madness.
>
> > So the error message seems to be the result of using an undeclared
> > procedure.
> > But why did I get an error message at runtime, with a halt in
> > execution, and Mitchell did not (according to his output). Unless the
> > procedure does need to be present, and he's referring to another
> > source of insanity. :)
>
> I suspect that make_block is a procedure or record that produces an
> object with fewer than 10 components. Try adding this declaration to
> your code:
>
>        record make_block(x, y, z)

didn't work! Mitchell's "qei" choked on this expression.

carolet

unread,
Jan 27, 2011, 6:31:16 AM1/27/11
to

Did you put it inside a procedure? It needs to be outside.

--

CaroleT


duke

unread,
Jan 28, 2011, 8:43:36 AM1/28/11
to

dnormandin@select-man:~/Programming/Icon/code$
./qei
Icon Expression Evaluator, Version 1.2, type :? for help
> record make_block(x, y, z);
File qei_.icn; Line 10 # "record": invalid expression list
File qei_.icn; Line 10 # ")": missing then
>

I can't even get to the rest of the code, because of the error above.
I like using Mitchell's "qei" because I can avoid the edit/compile/run
thing. Although using emacs, that fairly painless.
--
Duke

0 new messages