sequence of procedure definitions and calls

2 views
Skip to first unread message

Patrik Tkáč

unread,
Dec 11, 2010, 2:43:38 AM12/11/10
to atala...@googlegroups.com
Hi all,


I didn't know that before I call the procedure, it must be defined sooner (in source code it must be placed before the procedure call statement)

for example


proc1: proc=
��� proc2


proc2: proc=
��� a = 1


is not compileable.


the right compileable sequence is:

proc2: proc=
��� a = 1

proc1: proc=
��� proc2


Would it be possible to fix it?
Of course it is not urgent.

Thankx

patarik

rudla

unread,
Jan 16, 2011, 10:49:15 AM1/16/11
to Atalan Programming Langugage
Currently, the compiler is one pass.
Multiple passes are not completely out of question, it is not high on
priority list though (also note, that most compilers have this
restriction).

In cases, when it is necessary to call the procedure before it is
declared, it is possible
to first declare it (define the header) and later assign the body.

sum:proc e,f:byte >s:byte

;here some other code

sum =
s = e + f

Rudla


On Dec 11 2010, 8:43 am, Patrik Tkáč <patari...@gmail.com> wrote:
> Hi all,
>
> I didn't know that before I call the procedure, it must be defined
> sooner (in source code it must be placed before the procedure call
> statement)
>
> for example
>
> /proc1: proc=
>      proc2
>
> proc2: proc=
>      a = 1
> /
>
> is not compileable.
>
> the right compileable sequence is:
>
> /proc2: proc=
>      a = 1
>
> //proc1: proc=
>      proc2
>
> /
Reply all
Reply to author
Forward
0 new messages