Apparent bug related to binary I/O

39 views
Skip to first unread message

dbohdan

unread,
Oct 26, 2017, 3:28:13 PM10/26/17
to yeti-lang

Hi, everyone.

I tried reading a binary file in Yeti using `binReadFile filename (binReadAll 0)`, but found that the returned list<number> does not behave normally and produces unexpected results when you apply the function `drop 1 . find (== 10)` to it. This does not happen if you compile an apparently identical list into the program or apply `map id` to the list first. Did I run into a bug?

I've attached a shell script that runs several different Yeti code snippets to demonstrate when the behavior occurs and doesn't, and a text file of the output I get from the script. I expected the output from test 4 and 5 to be identical to that from test 6, but, as you can see in the text file, it is truncated. I've reproduced the results with OpenJDK 8 on two Linux distributions and OpenJDK 6 and 8 on FreeBSD 11.

Best,
D. Bohdan
test-yeti-binReadFile.sh
output.txt

Madis Janson

unread,
Oct 30, 2017, 6:48:29 PM10/30/17
to yeti-lang
Thank you for reporting it.

That was a bug in find specialization for byte lists.

Should be fixed in commit a6be58a1e0cd91568b6cb7ce3356d79e3d830287,
I uploaded new version of yeti.jar.

http://dot.planet.ee/yeti/yeti.jar

dbohdan

unread,
Dec 19, 2017, 12:23:18 PM12/19/17
to yeti-lang
Oops, looks like I forget to post my response.

Thanks for the fix! My code where I originally encountered the bug works in the new version.
Reply all
Reply to author
Forward
0 new messages