binary problem
[1/6] from: warp::reboot::ch at: 3-Mar-2001 12:56
>> a: read/binary %callmov.r
== #{
23212F7573722F6C6F63616C2F62696E2F7265626F6C2F7265626F6C202D6373
0A5245424F4C205B5D0A0A613A206C6F61642025767262696E320A633A20...
>> same? a read/binary %callmov.r
== false
>>
Hello 8)
Well I was expecting a true result..
Can please someone help ?
Is append a good way to join two binaries ?
Thanks
Will Arp
[2/6] from: dockimbel:free at: 3-Mar-2001 14:50
Hi Will,
Will Arp wrote:
> >> a: read/binary %callmov.r
> == #{
<<quoted lines omitted: 6>>
> Well I was expecting a true result..
> Can please someone help ?
Try with 'equal? instead of 'same? :
>> equal? a read/binary %callmov.r
== true
'same? will return 'true only if the two arguments refer (or point) to the
same memory space.
Basically, 'same? applied on immutable values should work as you expected.
For example with an integer! (immutable):
>> a: 5
== 5
>> b: a
== 5
>> same? a b
== true
>> c: 5
== 5
>> same? a c
== true ; true !
>> equal? a c
== true
but, with a string! (mutable):
>> a: "foo"
== "foo"
>> b: a
== "foo"
>> same? a b
== true
>> c: "foo"
== "foo"
>> same? a c
== false ; false !
>> equal? a c
== true
> Is append a good way to join two binaries ?
Sure, it's a good way. You can also use 'join (should be a little bit faster).
HTH,
DocKimbel.
[3/6] from: warp:reboot:ch at: 4-Mar-2001 5:56
Nenad,
Thanks a lot,
that works.
8)
Will
[4/6] from: warp:reboot:ch at: 4-Mar-2001 9:00
>> Is append a good way to join two binaries ?
>
> Sure, it's a good way. You can also use 'join (should be a little bit faster).
>
> HTH,
>
> DocKimbel.
Well I just dicovered my real problem..8(
Join, rejoin, append,.. Do not work as expected on REBOL 2.2.0.2.4
I just put the date back to 3 october 2000 and tried those same
functions on REBOL/core (Experimental) 2.4.36.2.4 and they do
behave as expected. 8)
My problem is that I really love rebol but have very little time
to spend with it and much of this time is spent in such
Platform-version problem.
My umble opinion is that the fact that "the same code work on x platforms
same" is one of the best argument rebol has, just to catch attention.
In rebol's case there should just be a .1% more attention on political
decision to release or not to release some code.
Example: you already have a build which will make my life easier ( rebol
itself already changed my life/computer a lot 8) ), the problem is it has
expired date so I can't use on production machines.
For sure there are many people out there using rebol for production which
wouldn't care paying $$ for it. ( OSX command version would be appreciated )
And because this "REBOL Zen / idioms" attentin Jeff was speaking about is
something people with little time cares when taking decisions on solutions..
Maybe something ala "rebol developer community" with annual fees could help.
Thank you,
Will Arp
[5/6] from: g:santilli:tiscalinet:it at: 4-Mar-2001 10:55
Hello Nenad!
On 03-Mar-01, you wrote:
NR>> Is append a good way to join two binaries ?
NR> Sure, it's a good way. You can also use 'join (should be a
NR> little bit faster).
Actually, JOIN would be a bit slower (but does not modify the
first series):
join: func [
"Concatenates values."
value "Base value"
rest "Value or block of values"
][
value: either series? value [copy value] [form value]
repend value rest
]
Regards,
Gabriele.
--
Gabriele Santilli <[giesse--writeme--com]> - Amigan - REBOL programmer
Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/
[6/6] from: dockimbel:free at: 5-Mar-2001 10:30
Hi Gabriele,
Gabriele Santilli wrote:
> Hello Nenad!
> On 03-Mar-01, you wrote:
<<quoted lines omitted: 11>>
> repend value rest
> ]
Thanks for correcting my mistake. I was really convinced that 'join was
native! (maybe it should be ?). Looks like i'm going to optimize a lot of
my code. :)
Cheers,
DocKimbel.
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted