Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005363OCamlOCaml generalpublic2011-09-29 20:152013-08-31 12:44
Reportermcandre 
Assigned Toprotz 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionwon't fix 
PlatformOSOS Version
Product Version3.12.0 
Target VersionFixed in Version 
Summary0005363: OCaml shebang syntax error
Description$ cat hello.ml
#!/usr/bin/env ocamlrun ocaml

let rec main = print_string "Hello World!\n"

$ ./hello.ml
Hello World!

$ ocaml hello.ml
Hello World!

$ ocamlc -o hello hello.ml
File "hello.ml", line 1, characters 0-1:
Error: Syntax error

$ ocamlopt -o hello hello.ml
File "hello.ml", line 1, characters 0-1:
Error: Syntax error

Similar to Erlang, OCaml permits shebangs in scripted mode, but borks in compiled mode. Please instruct the ocamlc and ocamlopt compilers to ignore shebangs.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0006455)
protz (manager)
2011-12-21 14:53

Hi,

That definitely seems wrong to me. Either you're developing a shell script, or you're writing a compiled program. The tasks achieved by the two styles are so different that I'm having a hard time seeing why you're switching back-and-forth between interpreted and compiled.

If you're just testing some features, why don't you just run ocaml hello.ml inside a terminal?

Cheers,

jonathan

- Issue History
Date Modified Username Field Change
2011-09-29 20:15 mcandre New Issue
2011-12-21 14:53 protz Note Added: 0006455
2011-12-21 14:54 protz Status new => resolved
2011-12-21 14:54 protz Resolution open => won't fix
2011-12-21 14:54 protz Assigned To => protz
2013-08-31 12:44 xleroy Status resolved => closed


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker