Date: Thu, 3 May 2001 15:54:43 +0200 To: Nicolas GEORGE Cc: Sven LUTHER , lablgtk at kaba.or.jp Subject: Re: lablgtk and pipes ... Message-ID: <20010503155443.A10742 at lambda.u-strasbg.fr> References: <20010503150545.A10308 at lambda.u-strasbg.fr> <20010503153115.A9616 at clipper.ens.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20010503153115.A9616 at clipper.ens.fr>; from nicolas.george at ens.fr on Thu, May 03, 2001 at 03:31:15PM +0200 From: Sven LUTHER Sender: Sven LUTHER On Thu, May 03, 2001 at 03:31:15PM +0200, Nicolas GEORGE wrote: > Le quartidi 14 floréal, an CCIX, Sven LUTHER a écrit : > > $ gunzip -c testgtk.ml.gz | lablgtk -labels > > Here, the toplevel is in interactive mode, so it requires the ;; before it > runs the statements. > > { gunzip -c testgtk.ml.gz; echo ';;' } | lablgtk -labels > > should work (depending on your shell) but there are dirty things on stdout. Well, (gunzip -c testgtk.ml.gz; echo ";;") | lablgtk -labels did work with bash. but like you said there is lot of scrolling of empty lines. > > $ gunzip -c testgtk.ml.gz | lablgtk -labels - > > The OCaml toplevel does not recognize - to be stdin. BUt it could be fixed to handle this ? Does this make sense ? > gunzip -c testgtk.ml.gz | lablgtk -labels /dev/fd/0 This works also, ... > should work, but it is very dirty. > > It is also possible to submit a feature wish/patch to the development > team : in toplevel/toploop.ml, > > let filename = find_in_path !Config.load_path name in > let ic = open_in_bin filename in > > could become > > let (filename, ic) = > if name = "-" then > (name, stdin) > else > let filename = find_in_path !Config.load_path name in > (filename, open_in_bin_filename) in > > But this may cause lots of problems (if the script uses stdin, or if the > user tries tu #use "-" when he is already using stdin). mmm, yes, this could be done. Is this a feature we would like to have and would be worth to be asked for, or is it something nobody will ever be needing aside of me, and i should let it be ? BTW, one could also imagine liking the ocaml toplevel with zlib and have it uncompress gzip'ed file on the fly. Friendly, Sven Luther