Skip to content

Latest commit

 

History

History
111 lines (53 loc) · 1.66 KB

Hello_Ada.md

File metadata and controls

111 lines (53 loc) · 1.66 KB

Jupiter Ada kernel

The kernel accepts an Ada program piece by piece. A piece could be:

  1. A sequence of context clauses:
with Ada.Text_IO;
  1. A sequence of declarative items to be elaborated:
Name : constant String := "World";
  1. A sequence of statements to be executed:
Ada.Text_IO.Put_Line ("Hello " & Name);
Hello World

Note: If one of declarative item requires a completion, then it should be in the same cell:

package P is
   procedure Proc;
end;

package body P is
   procedure Proc is
   begin
      Ada.Text_IO.Put_Line ("Here is Proc!");
   end;
end;

There are also some "magic" commands:

%lsmagic
Available line magics:
%lsmagic? %alr? %%output? %%writefile? %gargs? %cargs? %largs? %bargs?

You can use %alr magic command to install dependencies from the Ada Library Repository. Only shared library projects are supported.

%alr -q with spawn
Do you want to proceed?
Using default: Yes







Do you want Alire to automatically update your project file with the new dependency solution?
Using default: Yes
Do you want Alire to remember this choice?
Using default: No

After installing a crate with %alr you can use its units in with clauses:

with Spawn.Environments;
Ada.Text_IO.Put_Line (Spawn.Environments.System_Environment.Contains ("PATH")'Image);
TRUE