Sorry, I don't know where to post this...

M

Mikhail Kovalev

Was hoping someone can help me, does anyone know what programming
language this looks like:

@p @t\4@>@<Declare the procedure called |solve_choices|@>@;
procedure make_choices(@!knots:pointer);
label done;
var @!h:pointer; {the first breakpoint}
@!p,@!q:pointer; {consecutive breakpoints being processed}
@<Other local variables for |make_choices|@>@;
begin check_arith; {make sure that |arith_error=false|}
if internal[tracing_choices]>0 then
print_path(knots,", before choices",true);
@<If consecutive knots are equal, join them explicitly@>;
@<Find the first breakpoint, |h|, on the path;
insert an artificial breakpoint if the path is an unbroken cycle@>;
p:=h;
repeat @<Fill in the control points between |p| and the next
breakpoint,
then advance |p| to that breakpoint@>;
until p=h;
if internal[tracing_choices]>0 then
print_path(knots,", after choices",true);
if arith_error then @<Report an unexpected problem during the choice-
making@>;
end;

Thanks!=)
 
J

jacob navia

Mikhail said:
Was hoping someone can help me, does anyone know what programming
language this looks like:

@p @t\4@>@<Declare the procedure called |solve_choices|@>@;
procedure make_choices(@!knots:pointer);
label done;
var @!h:pointer; {the first breakpoint}
@!p,@!q:pointer; {consecutive breakpoints being processed}
@<Other local variables for |make_choices|@>@;
begin check_arith; {make sure that |arith_error=false|}
if internal[tracing_choices]>0 then
print_path(knots,", before choices",true);
@<If consecutive knots are equal, join them explicitly@>;
@<Find the first breakpoint, |h|, on the path;
insert an artificial breakpoint if the path is an unbroken cycle@>;
p:=h;
repeat @<Fill in the control points between |p| and the next
breakpoint,
then advance |p| to that breakpoint@>;
until p=h;
if internal[tracing_choices]>0 then
print_path(knots,", after choices",true);
if arith_error then @<Report an unexpected problem during the choice-
making@>;
end;

Thanks!=)

This looks like Knuth's literate programming language.

It is a way of writing the documentation AND the program. A preprocessor
separates the code from the Pascal and generates a compilable
program, and another preprocessor formats the code.

Code is processed by numbered blocks, for instance above
> @<Other local variables for |make_choices|@>@;
refers to a block where all those variables are defined.

This allows the code design from a top down manner.

To get more information google for "Literate programming"
"web" and "tangle", or look at the papers by Knuth on literate programming.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top