From: "Gautier direct_replies_not_read" <gautier_niouzes@hotmail.com>
Subject: Re: with and use
Date: Wed, 10 Jul 2002 17:20:00 +0000
Date: 2002-07-10T17:20:00+00:00 [thread overview]
Message-ID: <mailman.1026321663.26291.comp.lang.ada@ada.eu.org> (raw)
> > "with" and only appear at the top of a unit. Where can "use" appear?
>At any place a declaration can appear, and like any declaration, its
>effects extends from where it is declared to the corresponding
>"end". In addition, it can also appear in a context clause.
Maybe these examples could help to understand the "why".
(1)
with GL, GLU, GLUT, GLOBE_3D, Game_control, Level_Manager;
procedure GloDemo1 is
...
-- Here I don't want to open visibility
...
procedure Display is
use GL, GLOBE_3D; -- <-- Here but just here I want to open
-- visibility of the full GL bindings
begin
-- No need of "GL."
Clear( COLOR_BUFFER_BIT or DEPTH_BUFFER_BIT );
PushMatrix;
Translate ( -eye(0), -eye(1), -eye(2) );
Rotate( rot(0), 1.0, 0.0, 0.0 );
Rotate( rot(1), 0.0, 1.0, 0.0 );
Rotate( rot(2), 0.0, 0.0, 1.0 );
...
PopMatrix;
GL.Flush;
GLUT.SwapBuffers;
end Display;
...
(2)
with Ada.Text_IO; use Ada.Text_IO;
procedure xxx(f:File_Type) is
begin
null;
end xxx;
(3)
with Ada.Text_IO;
procedure xxx(f:Ada.Text_IO.File_Type) is
begin
null;
end xxx;
____________________________________________________________
Gautier -- http://www.mysunrise.ch/users/gdm/index.htm#Ada
NB: For a direct answer, address on the Web site!
_________________________________________________________________
Join the world�s largest e-mail service with MSN Hotmail.
http://www.hotmail.com
next reply other threads:[~2002-07-10 17:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-10 17:20 Gautier direct_replies_not_read [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-07-10 13:00 with and use David Rasmussen
2002-07-10 13:25 ` Jean-Pierre Rosen
2002-07-10 13:45 ` David Rasmussen
2002-07-10 14:24 ` Jean-Pierre Rosen
2002-07-10 19:17 ` Ted Dennison
2002-07-10 17:18 ` Jeffrey D. Cherry
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox