diff options
author | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 1999-12-07 15:01:12 +0000 |
---|---|---|
committer | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 1999-12-07 15:01:12 +0000 |
commit | aa78984afcb46226cbc35922af41ff79278a237a (patch) | |
tree | ea46e4d7c75c737e75d06b7e19824696bfb15b6f /otherlibs/labltk/support/support.ml | |
parent | bacf15f6140b9f78230fcd06058e2934cfdea067 (diff) |
changed syntax for default values and some labels
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2674 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/labltk/support/support.ml')
-rw-r--r-- | otherlibs/labltk/support/support.ml | 40 |
1 files changed, 1 insertions, 39 deletions
diff --git a/otherlibs/labltk/support/support.ml b/otherlibs/labltk/support/support.ml index eee855cae..6e1e835bf 100644 --- a/otherlibs/labltk/support/support.ml +++ b/otherlibs/labltk/support/support.ml @@ -1,46 +1,8 @@ (* $Id$ *) -(* Extensible buffers *) -type extensible_buffer = { - mutable buffer : string; - mutable pos : int; - mutable len : int} - -let new_buffer () = { - buffer = String.create len:128; - pos = 0; - len = 128 - } - -let print_in_buffer buf s = - let l = String.length s in - if buf.pos + l > buf.len then begin - buf.buffer <- buf.buffer ^ (String.create len:(l+128)); - buf.len <- buf.len + 128 + l - end; - String.blit s pos:0 to:buf.buffer to_pos:buf.pos len:l; - buf.pos <- buf.pos + l - -let get_buffer buf = - String.sub buf.buffer pos:0 len:buf.pos - - - -(* Used by list converters *) -let catenate_sep sep = - function - [] -> "" - | [x] -> x - | x::l -> - let b = new_buffer() in - print_in_buffer b x; - List.iter l - fun:(function s -> print_in_buffer b sep; print_in_buffer b s); - get_buffer b - (* Parsing results of Tcl *) (* List.split a string according to char_sep predicate *) -let split_str char_sep str = +let split_str pred:char_sep str = let len = String.length str in let rec skip_sep cur = if cur >= len then cur |