Code Monkey home page Code Monkey logo

Comments (4)

skull-squadron avatar skull-squadron commented on June 9, 2024
1] pry(main)> def foo(x)
[1] pry(main)*   x += 9
[1] pry(main)*   puts "hi"
[1] pry(main)*   x *= 3
[1] pry(main)*   x
[1] pry(main)* end
=> :foo
[2] pry(main)>
[3] pry(main)> def main
[3] pry(main)*   binding.pry
[3] pry(main)*   foo(3)
[3] pry(main)* end
=> :main
[4] pry(main)> main

From: (pry) @ line 9 Object#main:

     7: def main
     8:   binding.pry
 =>  9:   foo(3)
    10: end

[1] pry(main)> step

From: (pry) @ line 2 Object#foo:

    1: def foo(x)
 => 2:   x += 9
    3:   puts "hi"
    4:   x *= 3
    5:   x
    6: end

[1] pry(main)> step

From: (pry) @ line 3 Object#foo:

    1: def foo(x)
    2:   x += 9
 => 3:   puts "hi"
    4:   x *= 3
    5:   x
    6: end

[1] pry(main)>

from pry-inline.

skull-squadron avatar skull-squadron commented on June 9, 2024

Ahh... there's no output on the first statement. But the first statement mutates a value in the current scope, so it should still print something, yeah?

from pry-inline.

seikichi avatar seikichi commented on June 9, 2024

Thanks @steakknife
I reporoduced the problem.
I agree that the first statement x += 9 should print something like bellow:

[1] pry(main)> step
From: (pry) @ line 3 Object#foo: 

    1: def foo(x)
    2:   x += 9 # x: 12
 => 3:   puts "hi"
    4:   x *= 3
    5:   x    
    6: end

I'll fix the problem, please wait.

from pry-inline.

seikichi avatar seikichi commented on June 9, 2024

I fixed the problem and release v1.0.1. Thanks @steakknife

[1] pry(main)> def foo(x)                                                                                                                   
[1] pry(main)*   x += 9
[1] pry(main)*   puts 'hi'
[1] pry(main)*   x *= 3
[1] pry(main)*   x
[1] pry(main)* end  
=> :foo
[2] pry(main)> def main
[2] pry(main)*   binding.pry
[2] pry(main)*   foo(3)
[2] pry(main)* end  
=> :main
[3] pry(main)> main

From: (pry) @ line 9 Object#main:

     7: def main
     8:   binding.pry
 =>  9:   foo(3)
    10: end

[1] pry(main)> s

From: (pry) @ line 2 Object#foo:

    1: def foo(x) # x: 3
 => 2:   x += 9
    3:   puts 'hi'
    4:   x *= 3
    5:   x
    6: end

[1] pry(main)> n

From: (pry) @ line 3 Object#foo:

    1: def foo(x)
    2:   x += 9 # x: 12
 => 3:   puts 'hi'
    4:   x *= 3
    5:   x
    6: end

[1] pry(main)> n
hi

From: (pry) @ line 4 Object#foo:

    1: def foo(x)
    2:   x += 9 # x: 12
    3:   puts 'hi'
 => 4:   x *= 3
    5:   x
    6: end

[1] pry(main)> n

From: (pry) @ line 5 Object#foo:

    1: def foo(x)
    2:   x += 9
    3:   puts 'hi'
    4:   x *= 3 # x: 36
 => 5:   x
    6: end

from pry-inline.

Related Issues (6)

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.