comp.lang.ada
 help / color / mirror / Atom feed
From: Shark8 <OneWingedShark@gmail.com>
Subject: Possible GNAT bug w/ tasks and expression functions.
Date: Thu, 09 Oct 2014 18:30:01 -0600
Date: 2014-10-09T18:30:01-06:00	[thread overview]
Message-ID: <iMFZv.461$5U6.309@fx01.iad> (raw)

I get an interesting compiler error when I try to replace this

> -- Gen handles the actual creation of a new task and state.
> Function Gen(P : Peg; G : not null access Generate) return Generator is
> begin
>   return
>          (if G.Pegs(P) then null
>           else new Generate(
>               Pegs     => new Used_Peg'(G.Pegs.all & P),
>               State    => New Partial_Board'(G.All.State.All & P)
>            )
>           );
> end;

with

> -- Gen handles the actual creation of a new task and state.
> Function Gen(P : Peg; G : not null access Generate) return Generator is
>          (if G.Pegs(P) then null
>           else new Generate(
>               Pegs     => new Used_Peg'(G.Pegs.all & P),
>               State    => New Partial_Board'(G.All.State.All & P)
>            )
>           );

As you can see, it is simply the transformation between the "proper 
subprogram" form and the expression-function form; something which the 
ARM says is equivalent.

Fully compilable code here:
	http://rosettacode.org/wiki/Solve_the_no_connection_puzzle#Ada

I was wondering if any of you have hit this issue as well.

                 reply	other threads:[~2014-10-10  0:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox