roc icon indicating copy to clipboard operation
roc copied to clipboard

Add example reverse

Open matthiasbeyer opened this issue 4 years ago • 1 comments

DRAFT

This is a draft. I cannot create a draft PR (don't know why).

It is intentionally based on an old version of trunk because with a newer version it does not work anymore.

Of course, removing the free call in the roc_std might not be the correct way to do this :laughing: but I am still learning and this solved my issue with the example. My question now would be: where is the issue in the example code that causes the double free I'm seeing (without the change to roc_std)?

Also: The produced output is not yet as expected. Don't know why.

Please do NOT merge

matthiasbeyer avatar Oct 30 '21 08:10 matthiasbeyer

You just hit a bug with RocList.into_iter(). into_iter was causing the double free and the printout to potentially be printing freed memory. Also, it looks like fixing the bug makes this work with an updated trunk.

bhansconnect avatar Nov 02 '21 17:11 bhansconnect

@matthiasbeyer Was the goal of this example more to showcase the args-taking platform, the reversing app, or the simple/useful functionality? Considering that today's primary example (example/cli-platform) takes args, if this example is still wanted then we should switch this app to use that platform instead and delete all new platform code from this PR.

@rtfeldman What do you think today about simple Linux-shell-esque examples like this one?

kili-ilo avatar Sep 25 '22 02:09 kili-ilo

Huh, this was a long time ago. I think the idea here was mainly the args-taking part. The reversing is not that interesting after all.

matthiasbeyer avatar Sep 25 '22 07:09 matthiasbeyer

That makes sense! Args are awesome. Since examples/cli-platform takes args, should we abandon this example?

kili-ilo avatar Sep 25 '22 07:09 kili-ilo

This partly inspired https://GitHub.com/JanCVanB/rocbox :)

kili-ilo avatar Sep 27 '22 16:09 kili-ilo