From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id AF0527FACB for ; Sun, 14 Sep 2014 17:19:22 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of oliver@first.in-berlin.de) identity=pra; client-ip=192.109.42.8; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="oliver@first.in-berlin.de"; x-sender="oliver@first.in-berlin.de"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of oliver@first.in-berlin.de) identity=mailfrom; client-ip=192.109.42.8; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="oliver@first.in-berlin.de"; x-sender="oliver@first.in-berlin.de"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@einhorn.in-berlin.de) identity=helo; client-ip=192.109.42.8; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="oliver@first.in-berlin.de"; x-sender="postmaster@einhorn.in-berlin.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApwBAMCwFVTAbSoInGdsb2JhbABgg2BbgniyGpQyh04BgQUWEAEBAQEBCAsJCRQqhAMBAQEDASMEETYLBQsLGAICCQ8OAgIhJBIGExKIGAMJCAQJonCOBwMKhnUBF4Esi3SCLQeCeIFTBYUNBZByhHSCD4FghWOHPwOEYYNBHoFbagGCSQEBAQ X-IPAS-Result: ApwBAMCwFVTAbSoInGdsb2JhbABgg2BbgniyGpQyh04BgQUWEAEBAQEBCAsJCRQqhAMBAQEDASMEETYLBQsLGAICCQ8OAgIhJBIGExKIGAMJCAQJonCOBwMKhnUBF4Esi3SCLQeCeIFTBYUNBZByhHSCD4FghWOHPwOEYYNBHoFbagGCSQEBAQ X-IronPort-AV: E=Sophos;i="5.04,521,1406584800"; d="scan'208";a="79202422" Received: from einhorn.in-berlin.de ([192.109.42.8]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 Sep 2014 17:19:21 +0200 X-Envelope-From: oliver@first.in-berlin.de Received: from yak (yak.in-berlin.de [192.109.42.109]) by einhorn.in-berlin.de (8.14.4/8.14.4/Debian-4) with ESMTP id s8EFJEdG030298 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 14 Sep 2014 17:19:14 +0200 Received: from e178025081.adsl.alicedsl.de (e178025081.adsl.alicedsl.de [85.178.25.81]) by webmail.in-berlin.de (Horde Framework) with HTTP; Sun, 14 Sep 2014 17:19:13 +0200 Date: Sun, 14 Sep 2014 17:19:13 +0200 Message-ID: <20140914171913.Horde.5ym-R_j1HqynxlbIFQJykQ2@webmail.in-berlin.de> From: Oliver Bandel To: Gabriel Scherer Cc: Benjamin Greenman , OCaml mailing-list References: <20140914004715.Horde.0vNRgNUsRsqsjnX3ZDjGPQ9@webmail.in-berlin.de> In-Reply-To: User-Agent: Internet Messaging Program (IMP) H5 (6.2.0) Content-Type: text/plain; charset=UTF-8; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline Subject: Re: [Caml-list] With String.sub I need to catch "Bytes.sub" exception Also it's strange to get Messages that indicate error-reason in the wrong place. Ciao, Oliver Zitat von Gabriel Scherer (Sun, 14 Sep 2014 11:14:22 +0200) > Even if it's not technically a regression against the specification as per > Benjamin's message above, breaking working code is still not very good. > Could you please report this on the OCaml bugtracker? > > http://caml.inria.fr/mantis/ > > On Sun, Sep 14, 2014 at 12:53 AM, Benjamin Greenman > wrote: > >> Why do you match on the error string? String.sub is only documented to >> raise "Invalid_argument _". >> >> http://caml.inria.fr/pub/docs/manual-ocaml/libref/String.html >> >> On Sat, Sep 13, 2014 at 6:47 PM, Oliver Bandel >> wrote: >> >>> Hello, >>> >>> is this a known bug? >>> >>> Needed to change code from >>> >>> with Invalid_argument("Strings.sub") >>> to >>> with Invalid_argument("Bytes.sub") >>> >>> The code now looks like this and then works again: >>> >>> >>> try >>> if parser_url_len > 0 && parser_url = String.sub url >>> 0 parser_url_len then parser_name else aux tl >>> with Invalid_argument("Bytes.sub") -> aux tl (* this >>> happens if url is shorter than parser_url *) >>> >>> >>> Ciao, >>> Oliver >>> >>> >>> -- >>> Caml-list mailing list. Subscription management and archives: >>> https://sympa.inria.fr/sympa/arc/caml-list >>> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners >>> Bug reports: http://caml.inria.fr/bin/caml-bugs >>> >> >>