comp.lang.ada
 help / color / mirror / Atom feed
* Ada sources MIME type
@ 2011-03-10 10:01 Yannick Duchêne (Hibou57)
  2011-03-30 17:40 ` Yannick Duchêne (Hibou57)
  0 siblings, 1 reply; 4+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2011-03-10 10:01 UTC (permalink / raw)


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).

Application with no first support for Ada and just aware of Pascal, would  
not really do a mess-up of Ada sources.

Well, just an idea which came with the wind... not a main topic, as said  
above.


-- 
Si les chats miaulent et font autant de vocalises bizarres, c’est pas pour  
les chiens.

“I am fluent in ASCII” [Warren 2010]



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ada sources MIME type
  2011-03-10 10:01 Ada sources MIME type Yannick Duchêne (Hibou57)
@ 2011-03-30 17:40 ` Yannick Duchêne (Hibou57)
  2011-03-30 18:42   ` Georg Bauhaus
  0 siblings, 1 reply; 4+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2011-03-30 17:40 UTC (permalink / raw)


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]



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ada sources MIME type
  2011-03-30 17:40 ` Yannick Duchêne (Hibou57)
@ 2011-03-30 18:42   ` Georg Bauhaus
  2011-03-30 19:49     ` Randy Brukardt
  0 siblings, 1 reply; 4+ messages in thread
From: Georg Bauhaus @ 2011-03-30 18:42 UTC (permalink / raw)


On 30.03.11 19:40, Yannick Duchêne (Hibou57) wrote:
>  promote a "text/x-ada-spec" and an
> "text/x-ada-body" MIME types for Ada source files.

Against.  Though not against specifying file content's
type and encoding!

Use extended attributes.  Available in all file systems
and archives in current use.

An Ada source file can contain multiple compilation units,
and pragmas; what do you suggest if a single file has a spec,
a body, a separate unit, and configuration pragmas,
i.e. a complete Ada program text?

That's why I'm against text/x-ada-*  A MIME type should
relate possible Ada content, not accidentals like a
correspondence between compilation units and files the
way a single compiler prefers.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ada sources MIME type
  2011-03-30 18:42   ` Georg Bauhaus
@ 2011-03-30 19:49     ` Randy Brukardt
  0 siblings, 0 replies; 4+ messages in thread
From: Randy Brukardt @ 2011-03-30 19:49 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1369 bytes --]


"Georg Bauhaus" <rm.dash-bauhaus@futureapps.de> wrote in message 
news:4d93797a$0$6878$9b4e6d93@newsspool2.arcor-online.net...
> On 30.03.11 19:40, Yannick Duch�ne (Hibou57) wrote:
>>  promote a "text/x-ada-spec" and an
>> "text/x-ada-body" MIME types for Ada source files.
>
> Against.  Though not against specifying file content's
> type and encoding!
>
> Use extended attributes.  Available in all file systems
> and archives in current use.
>
> An Ada source file can contain multiple compilation units,
> and pragmas; what do you suggest if a single file has a spec,
> a body, a separate unit, and configuration pragmas,
> i.e. a complete Ada program text?
>
> That's why I'm against text/x-ada-*  A MIME type should
> relate possible Ada content, not accidentals like a
> correspondence between compilation units and files the
> way a single compiler prefers.

Not to mention what happens when the source file is a procedure or instance 
of a generic procedure or a procedure or task subunit. Janus/Ada calls all 
of those things "bodies" for the sake of it's file naming conventions, but 
I've also seen people and projects which given those their own extension 
".PRC" or "ADP".

Net effect is that there are as many ways to do this as there are projects; 
it doesn't make sense to encode any of them in stone.

                                   Randy.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-03-30 19:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-10 10:01 Ada sources MIME type Yannick Duchêne (Hibou57)
2011-03-30 17:40 ` Yannick Duchêne (Hibou57)
2011-03-30 18:42   ` Georg Bauhaus
2011-03-30 19:49     ` Randy Brukardt

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