[GHC] #1232: generalise runhaskell to support arbitrary file
names, not just those with .{l}hs extensions
Frederik Eaton
frederik at a5.repetae.net
Sat Apr 14 08:04:52 EDT 2007
Hi Igloo,
We are not suggesting that runhaskell should support a leading #! line
- it already does. The argument is about whether it should support
files that don't have an extension.
Also, this is a tangent, but: for "files" that start with #!, I
generally interpret the lines following the first line as the "real"
file. I.e., if a file is being interpreted via the #! mechanism by (or
any other interpreter), then the interpreter should consider
everything following the initial line to be the "real file" for the
purposes of code parsing. If the interpreter doesn't know whether it
is being run via "#!" or not, then it can simply check the first two
characters of the file - if they are "#!" (which no legal haskell file
starts with) then it should be safe to assume that it is.
Frederik
On Fri, Mar 30, 2007 at 08:03:04PM -0000, GHC wrote:
> #1232: generalise runhaskell to support arbitrary file names, not just those with
> .{l}hs extensions
> -----------------------------+----------------------------------------------
> Reporter: Frederik | Owner:
> Type: feature request | Status: new
> Priority: normal | Milestone: 6.8
> Component: Compiler | Version: 6.6
> Severity: normal | Resolution:
> Keywords: runhaskell | Difficulty: Easy (1 hr)
> Testcase: | Architecture: Multiple
> Os: Unknown |
> -----------------------------+----------------------------------------------
> Comment (by igloo):
>
> I don't think runhaskell should be encouraging people to write files that
> aren't valid Haskell, and thus that a Haskell-compliant implementation
> might not be able to load.
>
> I wouldn't object to Haskell' saying a leading `#!` line, or any line
> starting with `#` or `#!`, will be treated as a comment, though (something
> like this seems to be where we are in practice anyway).
>
> --
> Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1232>
> GHC <http://www.haskell.org/ghc/>
> The Glasgow Haskell Compiler
> _______________________________________________
> Glasgow-haskell-bugs mailing list
> Glasgow-haskell-bugs at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
--
http://ofb.net/~frederik/
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs at haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
More information about the Glasgow-haskell-bugs
mailing list