comp.lang.ada
 help / color / mirror / Atom feed
From: "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr>
Subject: Re: Ada sources MIME type
Date: Wed, 30 Mar 2011 19:40:57 +0200
Date: 2011-03-30T19:40:57+02:00	[thread overview]
Message-ID: <op.vs53ejv9ule2fv@douda-yannick> (raw)
In-Reply-To: op.vr4gr6ofule2fv@index.ici

Le Thu, 10 Mar 2011 11:01:08 +0100, Yannick Duchêne (Hibou57)  
<yannick_duchene@yahoo.fr> a écrit:

> Hello,
>
> Sorry, not a main target topic. I've noticed after GNAT was installed in  
> Ubuntu, it seems it added a MIME type for Ada sources (good, or may be  
> it was there before, I do not know). The MIME type is defined to be  
> “x-adasrc” and its parent type is defined as “text/plain”. Looks nice,  
> but the same way all C derived languages defines “text/x-csrc” as their  
> parent type (whose parent is in turn “text/plain”, obviously), I was  
> thinking this may be more nice to define the parent type of “x-adasrc”  
> as “x-pascal” (which already exists in the default MIME data base).
Also, C sources MIME type makes distinction between implementation and  
specification (C and H files), while there is actually even not really  
such a thing in C. Ada really has this, and its MIME type makes no  
distinction (we can't accept this any longer [*]). So I suggest anyone  
able to push, will try to push/promote/enforce this: promote a  
"text/x-ada-spec" and an "text/x-ada-body" MIME types for Ada source  
files. For integration in Unicies systems using a file type detection  
based on the file content, we should not rely on file extension, as this  
is vendor specific (although this could be used as a fall-back, at least  
on Windows), and instead rely on this: if the file contains a "^package  
body .*$" then it is a text/x-ada-body, and if it contains a "^package  
[A-Z].*$" (which should cover most of cases) then it is a text/x-ada-spec







[*] I wanted to play the fool a bit with this post wordings.

-- 
Si les chats miaulent et font autant de vocalises bizarres, c’est pas pour  
les chiens.
“ c++; /* this makes c bigger but returns the old value */ ” [Anonymous]



  reply	other threads:[~2011-03-30 17:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-10 10:01 Ada sources MIME type Yannick Duchêne (Hibou57)
2011-03-30 17:40 ` Yannick Duchêne (Hibou57) [this message]
2011-03-30 18:42   ` Georg Bauhaus
2011-03-30 19:49     ` Randy Brukardt
replies disabled

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