Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
binary:part/2/3
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Zabrane Mickael  
View profile  
 More options Aug 13 2012, 1:52 pm
From: Zabrane Mickael <zabra...@gmail.com>
Date: Mon, 13 Aug 2012 19:52:15 +0200
Local: Mon, Aug 13 2012 1:52 pm
Subject: [erlang-questions] binary:part/2/3

Hi guys,

I'd like to know if the binary returned by "binary:part/2/3" (http://www.erlang.org/doc/man/binary.html#part-2)
is always referencing Subject (i.e a sub-binary) or not?

The doc is clear about this fact for "binary:split/2/3" but nothing is mentionned for "binary:part/2/3".

Regards,
Zabrane

_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jesper Louis Andersen  
View profile  
 More options Aug 14 2012, 5:54 am
From: Jesper Louis Andersen <jesper.louis.ander...@erlang-solutions.com>
Date: Tue, 14 Aug 2012 11:54:30 +0200
Local: Tues, Aug 14 2012 5:54 am
Subject: Re: [erlang-questions] binary:part/2/3
Try looking at the source. If I remember correctly, binary:split uses binary:part inside. If this is the case, then you can update the documentation as well to reflect the fact.

Jesper Louis Andersen
  Erlang Solutions Ltd., Copenhagen

On Aug 13, 2012, at 7:52 PM, Zabrane Mickael <zabra...@gmail.com> wrote:

> Hi guys,

> I'd like to know if the binary returned by "binary:part/2/3" (http://www.erlang.org/doc/man/binary.html#part-2)
> is always referencing Subject (i.e a sub-binary) or not?

> The doc is clear about this fact for "binary:split/2/3" but nothing is mentionned for "binary:part/2/3".

> Regards,
> Zabrane

> _______________________________________________
> erlang-questions mailing list
> erlang-questi...@erlang.org
> http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Zabrane Mickael  
View profile  
 More options Aug 14 2012, 6:10 am
From: Zabrane Mickael <zabra...@gmail.com>
Date: Tue, 14 Aug 2012 12:10:29 +0200
Local: Tues, Aug 14 2012 6:10 am
Subject: Re: [erlang-questions] binary:part/2/3
Hi Jesper,

You're right. From "binary.erl" source code:

[..]
split(Haystack,Needles,Options) ->
...
        do_split(Haystack,MList,0,Trim)
...

do_split(H,[],N,true) when N >= byte_size(H) ->
    [];
do_split(H,[],N,_) ->
    [binary:part(H,{N,byte_size(H)-N})];            <---- HERE
do_split(H,[{A,B}|T],N,Trim) ->
    case binary:part(H,{N,A-N}) of                      <---- HERE
    ...

So yes, binary:split uses binary:part for sure.

Can OTP guys confirm this fact now?

Regards,
Zabrane

On Aug 14, 2012, at 11:54 AM, Jesper Louis Andersen wrote:

_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »