Closed dariusk closed 3 years ago
Oh gosh, thank you for alerting me to this error! I am looking into it. I have replicated your error on my system and can confirm we are looking at the same error.
I am trying to figure out with my code where the problem is.
Some good news and some bad news. The good news: I am on track for making a bug fix for this specific issue. Basically, I tried rewriting my function standard_write iteratively instead of recursively so as hopefully not to run out of stack space, and that change solved your specific problem. It's not up yet as a pull request because I need to tighten up the rewritten function a bit more, make sure other calls from elsewhere to that function go smoothly, and do more local testing first. But on a preliminary local test with your exact data as above, it works and produces 50000 words output. I'm hoping to have that specific item in as a pull request in the dev branch around 24h from now if there are no hiccups cropping up with that change and if I can complete the testing in that timeframe.
The bad news: If I change your novel.txt
code to instead achieve the number of words via a LOOP command as shown below, then again we wind up with a stack level too deep error on ruby interpreter. Most likely, I'll have to also rewrite my loop_iterator function iteratively :( which is recursive despite its name! I'll raise this one as a separate issue.
LOOP 50000W
WRITE mysentences wfolder
LOOPEND
Interestingly, not all instances of LOOP 50000W have problems in YeetWords - I have one in another repository that is working fine, see https://github.com/verachell/Limericks-NaNoGenMo-2021
One bug fix at a time though - I'll go ahead first with the bug fix specific to the issue you raised.
Sounds good, thank you! I'm having a lot of fun with the tool so far, btw. The documentation is great, too.
On Mon, Nov 1, 2021, 3:42 PM Vera Chellgren @.***> wrote:
Some good news and some bad news. The good news: I am on track for making a bug fix for this specific issue. Basically, I tried rewriting my function standard_write iteratively instead of recursively so as hopefully not to run out of stack space, and that change solved your specific problem. It's not up yet as a pull request because I need to tighten up the rewritten function a bit more, make sure other calls from elsewhere to that function go smoothly, and do more local testing first. But on a preliminary local test with your exact data as above, it works and produces 50000 words output. I'm hoping to have that specific item in as a pull request in the dev branch around 24h from now if there are no hiccups cropping up with that change and if I can complete the testing in that timeframe.
The bad news: If I change your novel.txt code to instead achieve the number of words via a LOOP command as shown below, then again we wind up with a stack level too deep error on ruby interpreter. Most likely, I'll have to also rewrite my loop_iterator function iteratively :( which is recursive despite its name! I'll raise this one as a separate issue.
LOOP 50000W WRITE mysentences wfolder LOOPEND
Interestingly, not all instances of LOOP 50000W have problems in YeetWords
- I have one in another repository that is working fine, see https://github.com/verachell/Limericks-NaNoGenMo-2021
One bug fix at a time though - I'll go ahead first with the bug fix specific to the issue you raised.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/verachell/YeetWords/issues/3#issuecomment-956785349, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACBBVSBVU5KYDRUHS4B5H3UJ4JT5ANCNFSM5HESPKSA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Thank you so much for bringing this problem with the WRITE command to my attention! I have now fixed this problem, tested the solution, and the changes have been merged into the main branch. The 1.1.1 release reflects this change. Let me know if you have any questions.
I'm going to tackle the similar issue https://github.com/verachell/YeetWords/issues/4 next (LOOP command).
Hello! I'm very excited to try YeetWords out for NaNoGenMo. I did immediately run into an issue doing the quick start tutorial. Here's my entire project:
sentence/mysentences.txt
word/noun.txt
novel.txt
When I run
ruby yeetwords.rb novel.txt
, this is the output:Clearly it's too many loops, and when I drop it down to
20000W
it works fine. I'm sure I could manually update my maximum stack size somewhere in my Ruby or system settings to fix the problem. But anyway, this is a Ruby error and should probably output something more human-friendly so I'm reporting it here!