Consider example: ``` s = Thread.new { a = 5 puts eval("a == b") x = 6 } s.join b = 11 ``` As far as I see it, it should not work. Because at the moment of eval, b is unknown and not even declared (it can even be in c...hurricup (Alexandr Evstigneev)
nobu (Nobuyoshi Nakada) wrote in #note-1: > To disable optimizations, see the document of `RubyVM::InstructionSequence.compile_option=`. > ... My question is more about the runtime. E.g I want to run a ruby program with optimizations d...hurricup (Alexandr Evstigneev)
ruby 3.4-preview2 seems optimizes out some stuff when building iseq and this may lead to user unexpected behavior when debugging, because some lines just optimized out. Example: ```ruby def foo1 if true nil else 1 ...hurricup (Alexandr Evstigneev)
sawa (Tsuyoshi Sawada) wrote in #note-1: > In general, precedence comes into play when an expression is ambiguous. An expression is ambiguous when there is more than one (grammatical) parse. `(a && b) = c` is not a grammatical parse of ...hurricup (Alexandr Evstigneev)
Unfortunately I could not find a good documentation regarding ruby operators precedence and associativity, but according to https://ruby-doc.org/3.2.2/syntax/precedence_rdoc.html `&&` has higher precedence than assignment. Meaning that...hurricup (Alexandr Evstigneev)
nobu (Nobuyoshi Nakada) wrote in #note-1: > That is one of symbols had been exported only for MJIT, and is declared in an internal header. > ... It is used in the debugger implementation. Can't say right now for what perticular reason,...hurricup (Alexandr Evstigneev)
As far as I understand headers, it still should be available. Still: ``` hurricup@AM-UNIT-0002:/usr/share/rvm/rubies$ nm -gD ruby-3.2.2/lib/libruby.so |grep ruby_vm_event_enabled_global_flags 00000000004497f4 B ruby_vm_event_enabl...hurricup (Alexandr Evstigneev)
This feels a bit inconsistent and I could not find an explanation. This is fine and `-` has higher precedence than `.` ``` -2.upto 0 do |arg| puts arg end ``` But this is not working, won't even compile (requires parens): ```...hurricup (Alexandr Evstigneev)
jeremyevans0 (Jeremy Evans) wrote in #note-4: > hurricup (Alexandr Evstigneev) wrote in #note-3: > ... Thank you for the explanation. This is totally understandable for me. I just saying that this may be non-intuitive for the languag...hurricup (Alexandr Evstigneev)
You are explaining from ruby developer perspective and it all makes sense. But from pure language user this feels really strange and inconsistent. Especially `puts((...))` :D `false or not false` is pretty valid expression. And any ...hurricup (Alexandr Evstigneev)