Git Product home page Git Product logo

yeetwords's People

Contributors

verachell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

yeetwords's Issues

Ruby runs out of stack space on large LOOP commands

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.

Ruby interpreter error on initital tutorial

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.