fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.
Fuzion
•
Idioms
•
Idiom # 238: Xor byte arrays
Idiom # 238: Xor byte arrays
See
programming-idioms.org
:
Code
# using array initialization c := array a.length (i -> a[i] ^ b[i]) # using Sequence.zip c := (a.zip b x,y->x^y).as_array
What are effects?
Running Example
ex238 is a array u8 := [0,1,2,3,4,5,6,7,8,9] b array u8 := [9,8,7,6,5,4,3,2,1,0] c0 := array a.length (i -> a[i] ^ b[i]) say c0 c1 := (a.zip b x,y->x^y).as_array say c1
What are effects?
last changed: 2024-07-01
next: NYI: Idiom # 239: Find first regular expression match