Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: [Caml-list] Runtime overflow and what to do
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jacques Garrigue <garrigue@k...>
Subject: Re: [Caml-list] Runtime overflow and what to do
From: Chris Hecker <checker@d6.com>
> >        echo "print_int Sys.word_size" > /tmp/caml$$
> >         WORDSIZE=`ocaml /tmp/caml$$`
> >         rm -f /tmp/caml$$
> 
> We clearly need a "-eval" switch to ocaml, like perl's -e/n/p.  :)

The above can be reduced to one line, without temporary file.
In fact, I feel more like we would need a "-silent" option, to get rid
of prompts and types (this is already the default with scripts).

echo "print_int Sys.word_size;;" | \
ocaml | grep "^# ." | sed -e "s/# //" -e "s/- :.*//"

A shorter but more specific approach is

echo "Sys.word_size;;" | ocaml | grep "# -" | sed -e "s/.*= //"

Jacques Garrigue
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners