caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* may be an other bug
@ 1996-02-15 14:19 Franck Delaplace
  1996-02-16 13:57 ` Xavier Leroy
  0 siblings, 1 reply; 2+ messages in thread
From: Franck Delaplace @ 1996-02-15 14:19 UTC (permalink / raw)
  To: caml-list



I built a script shell to add signature to .mli 
as follow

When I use it for global variabale as hash table 
the signature is 

let L = hashtbl__new 30 ;;

L : hashtbl__t  _a 

instead of the real instantion of L 

======================= 
if test -f $1.ml
then
	echo $1.mli  "transformation  en cours"
else
	echo le fichier $1.ml n existe pas
	exit 
fi

sed '/$1/d' $1.ml|sed '/\#open/w .tmp' > /dev/null #recuperation des open sauf les open ayan comme nom le fichier passe

if test -f $1.mli
then
	camlc -c $1.mli			# on compile le fichier .mli
	echo "(* -------------------------------*)" >.tmp
	cat $1.mli >> .tmp		# insertion dans .tmp du fichier	
fi

echo "(* fonction de  $1.ml  -----------------*)" 	>>.tmp
camlc  -c -i $1.ml >> .tmp
mv .tmp  $1.mli


echo "verifier le fichier genere "





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

* Re: may be an other bug
  1996-02-15 14:19 may be an other bug Franck Delaplace
@ 1996-02-16 13:57 ` Xavier Leroy
  0 siblings, 0 replies; 2+ messages in thread
From: Xavier Leroy @ 1996-02-16 13:57 UTC (permalink / raw)
  To: Franck Delaplace; +Cc: caml-list


> I built a script shell to add signature to .mli 
> as follow
> 
> When I use it for global variabale as hash table 
> the signature is 
> 
> let L = hashtbl__new 30 ;;
> 
> L : hashtbl__t  _a 
> 
> instead of the real instantion of L 
> 

The -i option to camlc prints the inferred types immediately after it
has been inferred. If the type is not generic, it may get instantiated
during the typing of the remainder of the file. E.g. :

        let L = hashtbl__new 30 ;;

                inferred type L: ('_a, '_b) hashtbl__t
                with '_a and '_b not generic

        hashtbl__add L 123 "hello" ;;
                '_a becomes int
                '_b becomes string
                L has type (int, string) hashtbl__t

The alternative, which is used in Caml Special Light, is to print the
types only at the end of the typing phase. Then, the types printed are
correct. But another user complained that if a type error occurs, no
types are printed...

- Xavier Leroy





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

end of thread, other threads:[~1996-02-16 15:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-02-15 14:19 may be an other bug Franck Delaplace
1996-02-16 13:57 ` Xavier Leroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).