verachell / yeetwords Goto Github PK
View Code? Open in Web Editor NEWa domain-specific language for text substitution
License: GNU General Public License v3.0
a domain-specific language for text substitution
License: GNU General Public License v3.0
This issue relates to a previous issue #3 . In certain situations, large loops such as the one below can result in Ruby running out of stack space and dropping out into the interpreter.
LOOP 50000W
WRITE mysentences wfolder
LOOPEND
Most likely, the fix would be rewriting the loop_iterator function iteratively instead of recursively.
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
I picked up the _NOUN_
word/noun.txt
hammer
saw
screwdriver
panda
novel.txt
WRITE mysentences wfolder 50000W
When I run ruby yeetwords.rb novel.txt
, this is the output:
Y| WELCOME :)
Y| Running your program...
Y| Reading file mysentences.txt
Y| Reading file noun.txt
<internal:kernel>:48:in `initialize_clone': stack level too deep (SystemStackError)
from <internal:kernel>:48:in `clone'
from yeetwords.rb:133:in `select_random'
from yeetwords.rb:2090:in `one_sentence_suball'
from yeetwords.rb:1463:in `standard_write'
from yeetwords.rb:1491:in `standard_write'
from yeetwords.rb:1491:in `standard_write'
from yeetwords.rb:1491:in `standard_write'
from yeetwords.rb:1491:in `standard_write'
... 4509 levels...
from yeetwords.rb:2272:in `block in loop_iterator'
from yeetwords.rb:2268:in `each'
from yeetwords.rb:2268:in `loop_iterator'
from yeetwords.rb:2374:in `<main>'
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!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.