Skip to content

Instantly share code, notes, and snippets.

@dminuoso
Created March 1, 2018 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dminuoso/3e95cef65f098961f1e2e4f3b3547154 to your computer and use it in GitHub Desktop.
Save dminuoso/3e95cef65f098961f1e2e4f3b3547154 to your computer and use it in GitHub Desktop.
λ ~ irb
irb(main):001:0> -> f { -> y { y[y] }[->x { f[-> v { x[x][v] }] }] }[-> f, x { x == Math.cos(x) ? x : f[Math.cos(x)]}.curry][10]; RubyVM::InstructionSequence.compile_option = { tailcall_optimization: true, trace_instruction: false }; -> f { -> y { y[y] }[->x { f[-> v { x[x][v] }] }] }[-> f, x { x == Math.cos(x) ? x : f[Math.cos(x)]}.curry][10]
SystemStackError: stack level too deep
from (irb):1:in `block (3 levels) in irb_binding'
from (irb):1:in `block in irb_binding'
from (irb):1:in `block (3 levels) in irb_binding'
from (irb):1:in `block in irb_binding'
from (irb):1:in `block (3 levels) in irb_binding'
from (irb):1:in `block in irb_binding'
from (irb):1:in `block (3 levels) in irb_binding'
from (irb):1:in `block in irb_binding'
from (irb):1:in `block (3 levels) in irb_binding'
from (irb):1:in `block in irb_binding'
from (irb):1:in `block (3 levels) in irb_binding'
from (irb):1:in `block in irb_binding'
from (irb):1:in `block (3 levels) in irb_binding'
from (irb):1:in `block in irb_binding'
from (irb):1:in `block (3 levels) in irb_binding'
from (irb):1:in `block in irb_binding'
... 4044 levels...
from (irb):1:in `block (3 levels) in irb_binding'
from (irb):1:in `block in irb_binding'
from (irb):1:in `block (3 levels) in irb_binding'
from (irb):1:in `block in irb_binding'
from (irb):1:in `block (3 levels) in irb_binding'
from (irb):1:in `block in irb_binding'
from (irb):1:in `block (3 levels) in irb_binding'
from (irb):1:in `block in irb_binding'
from (irb):1:in `block (3 levels) in irb_binding'
from (irb):1:in `block in irb_binding'
from (irb):1:in `block (3 levels) in irb_binding'
from (irb):1:in `block in irb_binding'
from (irb):1:in `block (3 levels) in irb_binding'
from (irb):1:in `block in irb_binding'
from (irb):1
from /Users/dminuoso/.rubies/ruby-2.4.1/bin/irb:11:in `<main>'
irb(main):002:0> -> f { -> y { y[y] }[->x { f[-> v { x[x][v] }] }] }[-> f, x { x == Math.cos(x) ? x : f[Math.cos(x)]}.curry][10]; RubyVM::InstructionSequence.compile_option = { tailcall_optimization: true, trace_instruction: false }; -> f { -> y { y[y] }[->x { f[-> v { x[x][v] }] }] }[-> f, x { x == Math.cos(x) ? x : f[Math.cos(x)]}.curry][10]
[1] 25295 segmentation fault irb
λ ~ irb --version
irb 0.9.6(09/06/30)
λ ~ ruby --version
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin17]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment