You can subscribe to this list here.
2003 |
Jan
|
Feb
(81) |
Mar
(97) |
Apr
(88) |
May
(80) |
Jun
(170) |
Jul
(9) |
Aug
|
Sep
(18) |
Oct
(58) |
Nov
(19) |
Dec
(7) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(22) |
Feb
(9) |
Mar
(28) |
Apr
(164) |
May
(186) |
Jun
(101) |
Jul
(143) |
Aug
(387) |
Sep
(69) |
Oct
(14) |
Nov
(8) |
Dec
(99) |
2005 |
Jan
(10) |
Feb
(34) |
Mar
(24) |
Apr
(7) |
May
(41) |
Jun
(20) |
Jul
(3) |
Aug
(23) |
Sep
(2) |
Oct
(26) |
Nov
(41) |
Dec
(7) |
2006 |
Jan
(6) |
Feb
(3) |
Mar
(11) |
Apr
|
May
|
Jun
(5) |
Jul
(8) |
Aug
(20) |
Sep
|
Oct
(6) |
Nov
(5) |
Dec
|
2007 |
Jan
|
Feb
(1) |
Mar
|
Apr
(3) |
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
(7) |
Oct
(6) |
Nov
(19) |
Dec
(11) |
2008 |
Jan
|
Feb
(7) |
Mar
(9) |
Apr
(21) |
May
(42) |
Jun
(27) |
Jul
(28) |
Aug
(26) |
Sep
(16) |
Oct
(32) |
Nov
(49) |
Dec
(65) |
2009 |
Jan
(35) |
Feb
(20) |
Mar
(36) |
Apr
(42) |
May
(111) |
Jun
(99) |
Jul
(70) |
Aug
(25) |
Sep
(15) |
Oct
(29) |
Nov
(3) |
Dec
(18) |
2010 |
Jan
(10) |
Feb
(4) |
Mar
(57) |
Apr
(63) |
May
(71) |
Jun
(64) |
Jul
(30) |
Aug
(49) |
Sep
(11) |
Oct
(4) |
Nov
(2) |
Dec
(3) |
2011 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
2024 |
Jan
(1) |
Feb
(3) |
Mar
(6) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2025 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Nicolas C. <war...@fr...> - 2004-04-09 13:16:13
|
> > Could you explain how really_input cannot be used on stdin ? Maybe I > > misunderstood the differences with input, but the documentation doesn't say > > anything about really_input not working on stdin. > > Apologies - I sent that by accident before I was ready, so it wasn't > phrased very well. Of course really_input works on stdin, I was > thinking of in_channel_length, and IO does wrap that appropriately. > > However, the specific case that was giving me problems was using IO as a > layer for accessing a stream compressed with zlib. The stream might be > stdin, so I can't count on knowing how long it is, but for efficiency I > want to read it in blocks rather than one byte at a time. In C I'd use > fread(), in ocaml normally I'd use Pervasives.input. IO currently > provides no equivalent. Sure, it can be done char by char with IO.read, > but I'm pretty sure that's going to wind up much less efficient than a > hypothetical function which called Pervasives.input, String.sub, or > whatever as appropriate. Sure. Actually IO does not work maybe well with buffered streams : the specification is that when you're reading n "elements" (characters or any) from an input, the result will be exactly the n elements you needed. Not more, and not less. This might actually be questionable : if you have spare time, could you suggest what parts of IO module should be modified in order to support buffered streams ? If it's only replacing Pervasives.really_input by input (and thus change the specification) I think it's worth doing. > I note that this seems to be inconvenient for you, too, going by the > zlib code you just posted. ;) Since I want to be able to use data from > stdin, and I want to be able to handle streams larger than > Sys.max_string_length, I can't use your version... This code is still experimental, and will surely be evolve into something more usable. As for everything else, any suggestion/code contribution will be apprecied. Regards, Nicolas Cannasse |
From: Nicolas C. <war...@fr...> - 2004-04-09 13:06:05
|
> > Here's another IO update : > > Just some remarks: They're actualy quite interesting ones :) > o Wouldn't it be better to rename read_i32 and write_i32 to > read_i31 and write_i31 ? Then you could add real read_i32 and > write_i32 functions based on native ints. The values that can be readed/written are 31 bits limited caml integers (on 32 bits platform , since 64 bits have 63 bits integers). But the size of the data readed / written is exactly 32 bits. That's true that some people might need the read_i32_full / write_i32_full functions that are returning int32 values, so let's add them. But having functions which name are claming reading/writting 31 bits looks highly suspicious for people who does not know about ocaml implementation details :-) > o read_line and read_string do not handle the case that the input > becomes empty before the terminating character is read. That's true. I just fixed it now - in the read_line case, thanks for the report. I will not in the read_string case since read_string is working on binary files and an not-null terminated string might be considered as the file being cut. > o As already pointed out by someone else, using \0 as terminating > character for strings is questionable. To support strings containing > \0 one could store strings in the format > > "number of characters" + "data". I already answered about this : I have been written the addons to IO in order to work easily when using C styled genered files. In C, strings are null terminated. > o A slight optimisation of write_byte would be to use > unsafe_char_of_int. I'll have a look at that. > o What about read_utf8 and write_utf8 ? I don't have knowledge in internationalizion, if you have some ideas about this, please feel free to contribute ! > o Have you made up your mind about supporting seekable streams? Not yet. This would need to add another closure to the IO prototype : I'm not yet sure it's worth it. Regards, Nicolas Cannasse |
From: Peter J. <pe...@jo...> - 2004-04-09 12:44:12
|
> Could you explain how really_input cannot be used on stdin ? Maybe I > misunderstood the differences with input, but the documentation doesn't say > anything about really_input not working on stdin. Apologies - I sent that by accident before I was ready, so it wasn't phrased very well. Of course really_input works on stdin, I was thinking of in_channel_length, and IO does wrap that appropriately. However, the specific case that was giving me problems was using IO as a layer for accessing a stream compressed with zlib. The stream might be stdin, so I can't count on knowing how long it is, but for efficiency I want to read it in blocks rather than one byte at a time. In C I'd use fread(), in ocaml normally I'd use Pervasives.input. IO currently provides no equivalent. Sure, it can be done char by char with IO.read, but I'm pretty sure that's going to wind up much less efficient than a hypothetical function which called Pervasives.input, String.sub, or whatever as appropriate. I note that this seems to be inconvenient for you, too, going by the zlib code you just posted. ;) Since I want to be able to use data from stdin, and I want to be able to handle streams larger than Sys.max_string_length, I can't use your version... |
From: Nicolas C. <war...@fr...> - 2004-04-09 12:25:48
|
> Hi list, > > Here's another IO update : > - added "pos_in" and "pos_out" that enable to know the current > reading/writing pos. > - the return of the pipe() function - this time working correctly. > > Regards > Nicolas Cannasse Just added to IO : val input_bits : (char,'a) input -> (bool,int) input val output_bits : (char,'a,'b) output -> (bool,(int * int),'b) output This enables you to read/write on bits-packed channels : let data = "....." in let i = IO.input_bits (IO.input_string data) in let b = IO.read i in (* read one bit as boolean *) let n = IO.nread i 7 in (* read the 7 other bits as a int value *= ... let o = IO.output_bits (IO.output_channel ch) in IO.write o true; IO.write o false; IO.nwrite o (6,63); (* write 63 as a 6-bits integer *) IO.nwrite o (3,0); (* write 3 bits *) IO.flush o; (* flush the current accumulator : this will pad current unwritten bits with 0's *) Regards, Nicolas Cannasse |
From: Achim B. <bl...@la...> - 2004-04-09 12:20:45
|
Hello, > Here's another IO update : Just some remarks: o Wouldn't it be better to rename read_i32 and write_i32 to read_i31 and write_i31 ? Then you could add real read_i32 and write_i32 functions based on native ints. o read_line and read_string do not handle the case that the input becomes empty before the terminating character is read. o As already pointed out by someone else, using \0 as terminating character for strings is questionable. To support strings containing \0 one could store strings in the format "number of characters" + "data". o A slight optimisation of write_byte would be to use unsafe_char_of_int. o What about read_utf8 and write_utf8 ? o Have you made up your mind about supporting seekable streams? Achim -- ________________________________________________________________________ | \_____/ | Achim Blumensath \O/ \___/\ | LaBRI / Bordeaux =o= \ /\ \| www-mgi.informatik.rwth-aachen.de/~blume /"\ o----| ____________________________________________________________________\___| |
From: Nicolas C. <war...@fr...> - 2004-04-09 11:47:56
|
> I'm slightly confused as to why the block reading primitive in the new > IO module is the equivalent of Pervasives.really_input rather than > Pervasives.input. It seems rather odd to have an input abstraction > provide, as a primitive, a function which cannot be used on stdin... Could you explain how really_input cannot be used on stdin ? Maybe I misunderstood the differences with input, but the documentation doesn't say anything about really_input not working on stdin. Regards, Nicolas Cannasse |
From: Nicolas C. <war...@fr...> - 2004-04-09 11:44:46
|
(getting back to some old thread) > > - base64 encode/decode > > - abstract high level I/O with support for C basic types ( read_i16 , > > write_f16 ..... ) > > - zlib deflate/inflate written in pure OCaml. > > One of the things I've been nooddling around with is a radicaly new I/O > arhitecture. The basic idea is to make i/o more like java and less like > C. The core idea is that there would be four classes of objects: > > 1) sinks and sources. These would be the fundamental sources/destinations > of the data- files, sockets, and strings would all be sinks and/or > sources. Most likely these will be built on top of the old-style Ocaml > I/O routines. > > 2) filters. These look like a sink or source, but wrap either a > sink/source or another filter. Examples of filters would > compression/decompression, encryption/decryption, mime or uu > encode/decode, eoln conversion, etc. Also, a filter might just collect > statistics on the stuff as it goes by, not changing the data- so line > counters, word counters, and check summers would be filters. Theses two are now reality in the IO module. For example, I managed to wrap CamlZip module on an IO and - without changing a line of my code - I can now read/write over normal or compressed files. Here's the code that's converting a standard IO into a compressed/uncompressed one. I think it's worth including into the ExtLib but the problem is it rely on another module (CamlZip, by Xavier Leroy) which itself contains C stubs using the ZLib. I think we need an additional folder into the ExtLib called "tools" that will be useful parts of code - yet not installed because of external dependencies. What do you think about the idea ? Here's the code - the inflate method is still broken since it requires to know the available data size, and is not "inflating on demand". Nicolas Cannasse ---- let inflate i = let available = ref (match IO.available i with None -> assert false | Some size -> size) in let buf = Buffer.create 0 in let refill str = let len = String.length str in if !available >= len then begin let data = IO.nread i len in String.blit data 0 str 0 len; available := !available - len; len end else begin let size = !available in let data = IO.nread i size in String.blit data 0 str 0 size; available := 0; size end in let flush str n = Buffer.add_substring buf str 0 n in Zlib.uncompress ~header:true refill flush; IO.input_string (Buffer.contents buf) let deflate o = let buf = Buffer.create 0 in let flush() = let data = Buffer.contents buf in let pos = ref 0 in let available = ref (String.length data) in let refill str = let len = String.length str in if !available >= len then begin String.blit data !pos str 0 len; available := !available - len; pos := !pos + len; len end else begin let size = !available in String.blit data !pos str 0 size; available := 0; pos := !pos + size; size end in let flush str n = if n = String.length str then IO.nwrite o str else IO.nwrite o (String.sub str 0 n) in Zlib.compress ~level:9 ~header:true refill flush; IO.flush o; Buffer.reset buf; in IO.create_out (Buffer.add_char buf) (Buffer.add_string buf) (fun () -> Buffer.length buf) (fun () -> flush(); IO.flush o) (fun () -> flush(); IO.close_out o) |
From: Peter J. <pe...@jo...> - 2004-04-09 11:28:26
|
I'm slightly confused as to why the block reading primitive in the new IO module is the equivalent of Pervasives.really_input rather than Pervasives.input. It seems rather odd to have an input abstraction provide, as a primitive, a function which cannot be used on stdin... |
From: Nicolas C. <war...@fr...> - 2004-04-08 10:44:06
|
Hi list, Here's another IO update : - added "pos_in" and "pos_out" that enable to know the current reading/writing pos. - the return of the pipe() function - this time working correctly. Regards Nicolas Cannasse |
From: Nicolas C. <war...@fr...> - 2004-04-03 09:33:47
|
> > In the implementation, you assume string is null-termintated (in > > read_string) and int is 32-bit long (in write_ui32). Both are not the > > case in OCaml. > > more idea on write_string/read_string. > > How about that write_string terminates a string by one of new line > characters, and read_string recognize all of LF, CRLF, CR? The line > I/O would be worthy addition. I agree with the string's suggestions, and propose the following : a pair of functions : - read_line / write_line that are recognizing LF/CRLF (not CR because we cannot push back readed data into the IO) - by default write_line will write an additionnal LF and if not opened in binary mode the underlying channel will convert it to CRLF on windows system. - keep read_string / write_string for null-terminated string (it makes sense since all theses additionnal API are made to work easily with C-generated binary files ) I will also add the write_i32/read_i32 functions : negative caml int should be accepted and converted to corresponding C-32-bits-represented negative value. Of course I'm here working here with 31 bits values so the bit we're loosing is the highest - before sign - one. We can add later write_real_i32 that will work with caml int32 type but for efficiency reasons the user can choose to use write_i32 as long there is exception guard to check overflows :-) Regards, Nicolas Cannasse |
From: Yamagata Y. <yor...@mb...> - 2004-04-03 04:45:10
|
From: Yamagata Yoriyuki <yor...@mb...> Subject: Re: [Ocaml-lib-devel] IO update Date: Sat, 03 Apr 2004 13:22:42 +0900 (JST) > In the implementation, you assume string is null-termintated (in > read_string) and int is 32-bit long (in write_ui32). Both are not the > case in OCaml. more idea on write_string/read_string. How about that write_string terminates a string by one of new line characters, and read_string recognize all of LF, CRLF, CR? The line I/O would be worthy addition. |
From: Yamagata Y. <yor...@mb...> - 2004-04-03 04:25:50
|
From: "Nicolas Cannasse" <war...@fr...> Subject: Re: [Ocaml-lib-devel] High Level IO Date: Thu, 25 Mar 2004 21:55:21 +0100 > They are blocking : > > let i = IO.input_channel ch in > let data = (match IO.available ch with > | None -> failwith "unknown data available" > | Some n -> IO.nread ch n > ) in > IO.close_in i; My comment of "non-blocking" is based on pipe code which you withdrawn. Do you intend to resurrect it? |
From: Yamagata Y. <yor...@mb...> - 2004-04-03 04:25:50
|
In the implementation, you assume string is null-termintated (in read_string) and int is 32-bit long (in write_ui32). Both are not the case in OCaml. Sorry for nit-picking :-) |
From: Nicolas C. <war...@fr...> - 2004-04-01 12:37:29
|
> Hi there, > > I have a suggestion for an additional function to put in > the Option module: > > let map_default f default = function > | None -> default > | Some v -> f v Added to the CVS. Regards, Nicolas Cannasse |
From: Bardur A. <oca...@sc...> - 2004-04-01 12:24:40
|
Hi there, I have a suggestion for an additional function to put in the Option module: let map_default f default = function | None -> default | Some v -> f v As you can see it's sort of "Option.may for expressions". I chose the name map_default because the function is basically a combination of Option.map and Option.default. Its behaviour is exactly identical to Option.default default (Option.map f x) where x is the last parameter to map_default. It can be convenient to have this function when building predicates for e.g. Set.for_all when the set in question contains option-type values. I also find that having one function for the job instead of having to string Option.map and Option.default together reduces clutter. Cheers, -- Bardur Arantsson <ba...@im...> <ba...@sc...> - Mmmmmmmmmmmmmmmm... something. Homer Simpson | The Simpsons |
From: Nicolas C. <war...@fr...> - 2004-04-01 09:22:49
|
Hi list, I just updated the IO module with the following functions : exception Overflow of string val read_byte : (char,'a) input -> int val read_string : (char,'a) input -> string val read_ui16 : (char,'a) input -> int val read_ui32 : (char,'a) input -> int val read_i16 : (char,'a) input -> int val write_byte : (char,'a,'b) output -> int -> unit val write_ui32 : (char,'a,'b) output -> int -> unit val write_ui16 : (char,'a,'b) output -> int -> unit val write_i16 : (char,'a,'b) output -> int -> unit val write_string : (char,string,'a) output -> string -> unit and also defined the useful : type stdin = (char, string) input type 'a stdout = (char, string,'a) output Now available on the CVS for review and comments. Regards, Nicolas Cannasse |
From: Richard J. <ri...@an...> - 2004-03-26 17:15:13
|
This might be an interesting model for an IO library: http://www.perl.com/pub/a/2004/03/12/ioall.html http://search.cpan.org/~ingy/IO-All-0.15/lib/IO/All.pm Rich. -- Richard Jones. http://www.annexia.org/ http://www.j-london.com/ Merjis Ltd. http://www.merjis.com/ - improving website return on investment C2LIB is a library of basic Perl/STL-like types for C. Vectors, hashes, trees, string funcs, pool allocator: http://www.annexia.org/freeware/c2lib/ |
From: Nicolas C. <war...@fr...> - 2004-03-25 20:58:33
|
> > > > I just commited today on the CVS the IO module already presented a few > > > > months ago. > > > > > > IO.ml seems broken. The definition of the "pipe" is incomplete. > > > > > > > That's true...I committed a little fast, > > I just removed "pipe" from the IO module. > > > > Nicolas Cannasse > > So, you made all IO non-blocking. (I mean success of reading operation is > not guaranteed.) It would make an operation like reading the whole > contents of channel into string to be very difficult... > They are blocking : let i = IO.input_channel ch in let data = (match IO.available ch with | None -> failwith "unknown data available" | Some n -> IO.nread ch n ) in IO.close_in i; Nicolas Cannasse |
From: Yamagata Y. <yor...@mb...> - 2004-03-24 03:35:42
|
From: "Nicolas Cannasse" <war...@fr...> Subject: Re: [Ocaml-lib-devel] High Level IO Date: Mon, 22 Mar 2004 11:27:32 +0100 > > > I just commited today on the CVS the IO module already presented a few > > > months ago. > > > > IO.ml seems broken. The definition of the "pipe" is incomplete. > > > > That's true...I committed a little fast, > I just removed "pipe" from the IO module. > > Nicolas Cannasse So, you made all IO non-blocking. (I mean success of reading operation is not guaranteed.) It would make an operation like reading the whole contents of channel into string to be very difficult... -- Yamagata Yoriyuki |
From: Yamagata Y. <yor...@mb...> - 2004-03-24 03:25:03
|
I have made new install.ml Changes are 1) ignore findlib if "-d" is specified. 2) ask questions only if related options are not given. 3) several modules depend on enum, so make enum compiled first. Please test it, and let me know your opinion. -- install.ml -- (* * Install - ExtLib installation * Copyright (C) 2003 Nicolas Cannasse * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *) open Printf type path = | PathUnix | PathDos let modules = [ "enum"; "bitSet"; "dynArray"; "extHashtbl"; "extList"; "extString"; "global"; "IO"; "option"; "pMap"; "refList"; "std"; "uChar"; "uTF8" ] let m_list suffix = String.concat " " (List.map (fun m -> m ^ suffix) modules) let obj_ext , lib_ext , cp_cmd , path_type = match Sys.os_type with | "Unix" | "Cygwin" | "MacOS" -> ".o" , ".a" , "cp", PathUnix | "Win32" -> ".obj" , ".lib" , "copy", PathDos | _ -> failwith "Unknown OS" let run cmd = prerr_endline cmd; let ecode = Sys.command cmd in if ecode <> 0 then failwith (sprintf "Exit Code %d - Stopped" ecode) let copy file dest = if dest <> "" && dest <> "." then begin prerr_endline ("Installing "^file); let path = dest ^ file in (try Sys.remove path with _ -> ()); try Sys.rename file path; with _ -> failwith "Aborted" end let complete_path p = if p = "" then p else let c = p.[String.length p - 1] in if c = '/' || c = '\\' then p else p^(match path_type with PathUnix -> "/" | PathDos -> "\\") let remove file = try Sys.remove file with _ -> prerr_endline ("Warning : failed to delete "^file) (** Do we have findlib? *) let is_findlib () = print_endline "Looking for findlib...\n"; let findlib = Sys.command "ocamlfind printconf" = 0 in print_endline "Done.\n"; if findlib then print_endline "We have findlib.\n" else print_endline "We do not have findlib.\n"; findlib type install_dir = Findlib | Dir of string let install() = let autodir = ref None in let docflag = ref None in let autodoc = ref false in let autobyte = ref false in let autonative = ref false in let usage = "ExtLib installation program v1.1\n(c)2003,2004 Nicolas Cannasse" in Arg.parse [ ("-d", Arg.String (fun s -> autodir := Some s) , "<dir> : install in target directory"); ("-b", Arg.Unit (fun () -> autobyte := true) , ": byte code installation"); ("-n", Arg.Unit (fun () -> autonative := true) , ": native code installation"); ("-doc", Arg.Unit (fun () -> docflag := Some true) , ": documentation installation"); ("-nodoc", Arg.Unit (fun () -> docflag := Some false) , ": documentation installation"); ] (fun s -> raise (Arg.Bad s)) usage; let findlib = is_findlib () in let install_dir = ( match !autodir with | Some dir -> if not !autobyte && not !autonative && not !autodoc then failwith "Nothing to do."; Dir (complete_path dir) | None -> let byte, native = if !autobyte || !autonative then (!autobyte, !autonative) else begin printf "Choose one of the following :\n1- Bytecode installation only\n2- Native installation only\n3- Both Native and Bytecode installation\n> "; (match read_line() with | "1" -> true, false | "2" -> false, true | "3" -> true, true | _ -> failwith "Invalid choice, exit.") end in let dest = if not findlib then begin printf "Choose installation directory :\n> "; let dest = complete_path (read_line()) in (try close_out (open_out (dest^"test.file")); Sys.remove (dest^"test.file"); with _ -> failwith ("Directory "^dest^" does not exists or cannot be written.")); Dir dest; end else Findlib in let doc = match !docflag with Some doc -> doc | None -> printf "Do you want to generate ocamldoc documentation (Y/N) ?\n> "; (match read_line() with | "y" | "Y" -> true | "n" | "N" -> false | _ -> failwith "Invalid choice, exit.") in autodoc := doc; autobyte := byte; autonative := native; dest ) in let doc_dir = match install_dir with Findlib -> "extlib-doc" | Dir install_dir -> sprintf "%sextlib-doc" install_dir in if !autodoc && not (Sys.file_exists doc_dir) then run (sprintf "mkdir %s" doc_dir); run (sprintf "ocamlc -c %s" (m_list ".mli")); if !autobyte then begin List.iter (fun m -> run (sprintf "ocamlc -c %s.ml" m)) modules; run (sprintf "ocamlc -a -o extLib.cma %s extLib.ml" (m_list ".cmo")); List.iter (fun m -> remove (m^".cmo")) modules; remove "extLib.cmo"; end; if !autonative then begin List.iter (fun m -> run (sprintf "ocamlopt -c %s.ml" m)) modules; run (sprintf "ocamlopt -a -o extLib.cmxa %s extLib.ml" (m_list ".cmx")); List.iter (fun m -> remove (m^".cmx"); remove (m^obj_ext)) modules; remove "extLib.cmx"; remove ("extLib"^obj_ext); end; if !autodoc then begin run (sprintf "ocamldoc -html -d %s %s" doc_dir (m_list ".mli")); run ((match path_type with | PathDos -> sprintf "%s odoc_style.css %s\\style.css"; | PathUnix -> sprintf "%s odoc_style.css %s/style.css") cp_cmd doc_dir); end; match install_dir with Findlib -> let files = Buffer.create 0 in List.iter (fun m -> Buffer.add_string files (m^".cmi"); Buffer.add_char files ' ') modules; Buffer.add_string files "extLib.cmi "; if !autobyte then Buffer.add_string files "extLib.cma "; if !autonative then begin Buffer.add_string files "extLib.cmxa "; Buffer.add_string files ("extLib"^lib_ext^" "); end; run (sprintf "%s META.txt META" cp_cmd); let files = Buffer.contents files in run (sprintf "ocamlfind install extlib %s META" files); | Dir install_dir -> List.iter (fun m -> copy (m^".cmi") install_dir) modules; copy "extLib.cmi" install_dir; if !autobyte then copy "extLib.cma" install_dir; if !autonative then begin copy "extLib.cmxa" install_dir; copy ("extLib"^lib_ext) install_dir; end; ;; try install(); printf "Done."; with Failure msg -> prerr_endline msg; exit 1 |
From: Jeffrey A. S. <je...@dh...> - 2004-03-23 21:12:58
|
Forgive the possibly off-topic question, but this is the only place I've found that's frequented by OCaml library gurus. If you know a better place to ask, please let me know. (I have been reading this list faithfully for a few months through gmane.org.) We are looking into using ocamlyacc for a project, but we would like to have the same control over error handling that was in Johnson's original yacc. Here are the things we'd like to have: o The ability to mix actions among the symbols of a production, as in: nonterminal : symbol { action-1 } symbol { action-2 } o The yyerrok facility (make the parse engine believe that parsing has resynchronized after an error) o The yyclearin facility (toss the current input token) The Berkeley sources on which ocamlyacc is based do have these facilities. Does anyone know why they weren't included in ocamlyacc in the first place? Is there a reason to believe they couldn't be added reasonably easily? We're getting ready to start hacking on ocamlyacc, and it would be very valuable to hear in advance if it's going to be more difficult than it seems. Thanks (in advance) for any advice. Regards, Jeff Scofield [PhD] DHI Technologies, Inc. Seattle |
From: Nicolas C. <war...@fr...> - 2004-03-22 10:28:33
|
> > I just commited today on the CVS the IO module already presented a few > > months ago. > > IO.ml seems broken. The definition of the "pipe" is incomplete. > That's true...I committed a little fast, I just removed "pipe" from the IO module. Nicolas Cannasse |
From: Yamagata Y. <yor...@mb...> - 2004-03-22 09:53:59
|
From: "Nicolas Cannasse" <war...@fr...> Subject: [Ocaml-lib-devel] High Level IO Date: Sun, 21 Mar 2004 11:12:22 +0100 > I just commited today on the CVS the IO module already presented a few > months ago. IO.ml seems broken. The definition of the "pipe" is incomplete. -- Yamagata Yoriyuki |
From: Nicolas C. <war...@fr...> - 2004-03-21 10:12:16
|
Hi list, I just commited today on the CVS the IO module already presented a few months ago. I'll like it to be a base for future work on abstract high-level IO. Don't hesitate to review it and propose additionals functions. Best Regards, Nicolas Cannasse |
From: Nicolas C. <war...@fr...> - 2004-03-21 10:02:32
|
> > Thanks, > > You're welcome :) > > > The CVS have been updated with your changes. To answer more precisely > > to your questions : > > - we could actualy use ints as 16 bits values if we add the API to > > extract them from strings, but we don't :) > > Why not to add this API ? It might also be useful in to improve other > data structures. And why only 16 bits and not 32 ? - We have to write C functions for that API. - 16 bits are currently handled by a single unboxed OCaml int. Using all 32-bits is possible if we box integers -> that means that we will alloc/free a lot of blocks around, that's not efficient. > > - we can't use Pervasives.compare because bitsets might be of > > different sizes but are actually the same integer > > I didn't want to say that Pervasives.compare should be used directly. I > suggested something like that : > > (************************************************************) > let extend t old_size new_size = > let b = bcreate new_size in > bblit !t 0 b 0 old_size; > bfill b old_size (new_size - old_size) 0; > b > > let compare t1 t2 = > let size1 , size2 = blen !t1 , blen !t2 in > if size1 < size2 then > Pervasives.compare (extend t1 size1 size2) !t2 > else if size1 > size2 then > Pervasives.compare !t1 (extend t2 size2 size1) > else > Pervasives.compare !t1 !t2 In this case, I think custom compare function is better since it doesn't require an allocation + a copy. There is not so big speed difference between (correctly written) OCaml code and C when compiled in native mode :) Nicolas Cannasse |