comp.lang.ada
 help / color / mirror / Atom feed
From: Marius Amado Alves <alves@systran.lu>
To: comp.lang.ada@ada.eu.org
Subject: Re: User define attributes
Date: Fri, 20 Apr 2001 19:08:31 +0000 (GMT)
Date: 2001-04-20T19:08:31+00:00	[thread overview]
Message-ID: <mailman.987786678.22933.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: <3ADDFE24.9B3E1038@gsde.hou.us.ray.com>

On Wed, 18 Apr 2001, Samuel T. Harris wrote:
> 
>     generic
> 	type Index_Type is (<>);
> 	type Component_Type is private;
>       ...
>     package Array_Attribute_Functions is
> 	function Width (Item : Array_Type) return Natural;
> 	function Image (Item : Array_Type) return String;
> 	function Value (Item : String) return Array_Type;
>     end Array_Attribute_Functions;
>
> ...

My package Bundles is along those lines.

generic

  type Names is (<>);

package Bundles is

  type Bundle_Type is array(Names) of Unbounded_String;

  function Bundle(
    S: String;
    Indicator: String := "=>";
    Separator: String := ",")
    return Bundle_Type;
      -- Parses a bundle representation S into a Bundle_Type.
      -- White space between tokens is ignored.
      -- Unnamed items are assigned Null_Unbounded_String.
      -- B = Bundle(Image(B)) holds.

  function Image(
    ...

It has served me long and well.

It is now in Adlib (lexis.di.fct.unl.pt/ADaLIB), category Miscelany.

--
Marius Amado Alves
 alves@systran.lu
Project Tradaut-Pt
Systran Luxembourg
12, Rue de Vianden
L-2680  LUXEMBOURG
Tel 352 + 45 46 53
Fax 352 + 45 74 75
Mob 351 +939354002






      parent reply	other threads:[~2001-04-20 19:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-14 13:33 User define attributes Ayende Rahien
2001-04-16  7:27 ` Martin Dowie
2001-04-16 11:23   ` Ayende Rahien
2001-04-16 11:37     ` Martin Dowie
2001-04-16 14:35       ` Samuel T. Harris
2001-04-16 15:20         ` Martin Dowie
2001-04-16 15:37           ` Brian Rogoff
2001-04-16 16:19           ` Samuel T. Harris
2001-04-16 17:08             ` Marin David Condic
2001-04-16 22:00               ` Samuel T. Harris
2001-04-17 12:34                 ` Georg Bauhaus
2001-04-17 20:35                   ` Samuel T. Harris
2001-04-24 21:00                   ` Samuel T. Harris
2001-04-16 17:37             ` Martin Dowie
     [not found]           ` <0tEC6.7646$FY5.638172@www.newsranger.com>
2001-04-16 17:34             ` Martin Dowie
2001-04-18 12:14         ` Marius Amado Alves
2001-04-18 20:50           ` Samuel T. Harris
2001-04-19  1:35             ` Jeffrey Carter
2001-04-19 12:50               ` Samuel T. Harris
2001-04-20 19:08             ` Marius Amado Alves [this message]
replies disabled

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