Browse thread
ocamlbuild single quotes causing trouble
-
Andrew Warshaver
-
Alain Frisch
-
Andrew Warshaver
- Philippe Wang
-
Andrew Warshaver
-
Alain Frisch
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Philippe Wang <lists@p...> |
| Subject: | Re: [Caml-list] ocamlbuild single quotes causing trouble |
Andrew Warshaver wrote:
>
> Alain Frisch wrote:
>> Andrew Warshaver wrote:
>>> it works just fine. I also discovered that if I don't use the ~
>>> abbrev.
>>> then everything is happy (although this took me a long time to
>>> discover!).
>>
>> The shell is responsible to expand ~ before calling the program. If you
>> quote it, it won't be expanded; this is normal. When you put ~ on
>> ocamlbuild's command line, as in "-I,~/multi-oc/lib" it is not expanded
>> either (~ is interpreted only at the beginning of a word on the command
>> line).
>>
> Thanks for the explanation. But is there any reason that ocamlbuild
> has to add the single quotes when transferring the argument to
> ocamlc? And, if it didn't, would it then work appropriately?
The quotes are necessary to consider that the block is a single argument.
If you want to remove those quotes, then you have to "guess" what the
user meant (i.e. guessing where the quotes would have been if they were
there).
In some cases, it's impossible to guess with a 100% accuracy...
Well, I suggest you to use $HOME instead of ~.
(then you have to use double quotes instead of quotes, so that the shell
expands $HOME, as the variables inside simple quotes don't expand --
well I hope you are not using a too weird shell ;-)
--
Philippe Wang
mail[at]philippewang.info