These are chat archives for opal/opal

13th
Apr 2016
Forrest Chang
@fkchang
Apr 13 2016 05:44
@elia are regex's slightly different in 0.8 and 0.9 ?
Forrest Chang
@fkchang
Apr 13 2016 05:53
apparently they are, upgraded to 0.9 and the regex in question behaves more like I think it should
Elia Schito
@elia
Apr 13 2016 06:04
@fkchang Tbh don't remember :)
Brady Wied
@wied03
Apr 13 2016 13:08
@fkchang - I did make some regex fixes for treating . the same in JS as Ruby.
CJ Lazell
@cj
Apr 13 2016 16:59
@elia @iliabylich opal/opal#1428
CJ Lazell
@cj
Apr 13 2016 17:20
@iliabylich are you around?
Ilya Bylich
@iliabylich
Apr 13 2016 17:21
@cj Yes
CJ Lazell
@cj
Apr 13 2016 17:21
I just replied, but probably easier to talk in real time :)
Ilya Bylich
@iliabylich
Apr 13 2016 17:22
Could you share your 'broken' file? It's hard to find out where the problem comes from
CJ Lazell
@cj
Apr 13 2016 17:22
added to the issue
0.8.0 compiles it just fine
Ilya Bylich
@iliabylich
Apr 13 2016 17:30
I know what's wrong, there's an issue with a token called tLBRACE_ARG. tr.add_class (new_is_read == '1' ? 'read' : 'unread') - try to remove here the space after add_class
This thing is one of my reasons to hate Ruby :smile:
def m(*args)
  p args
end

m (1)
# => 1

m (2, 3)
# => SyntaxError
This magical space is super weird. By calling a method using method_name (arg) you have to pass exactly one argument. If you don't pass any arguments (m ()) Ruby automagically passes nil to the method.
And this feature doesn't work properly on 0.10
Ilya Bylich
@iliabylich
Apr 13 2016 17:36
But your example clarifies it. It was made exactly for cases like yours, when you call a method without parentheses and provide a single complex argument wrapped with ()
Time to fix it! :smile:
Ilya Bylich
@iliabylich
Apr 13 2016 17:42
tLPAREN_ARG, not tLBRACE_ARG
CJ Lazell
@cj
Apr 13 2016 17:46
:D
Guillaume Grossetie
@Mogztter
Apr 13 2016 18:35
Hi
I'm trying to update from Opal 0.9.0.beta2 to Opal 0.9.2
Some Hash methods were renamed:
Hash.keys => Hash.$$keys Hash.map => Hash.$$map Hash.smap => Hash.$$smap
Is there an "easy" way to create an alias between old and new name ?
Guillaume Grossetie
@Mogztter
Apr 13 2016 18:41
Yes we do have users that rely heavily on smap :cry:
@fkchang work is in progress, I'm making good progress :wink:
Ilya Bylich
@iliabylich
Apr 13 2016 18:50
@Mogztter it was renamed because object.property is an instance variable
$$prop is an internal Opal property
Guillaume Grossetie
@Mogztter
Apr 13 2016 19:05
I'm sure there's a good reason for this renaming
but I want to be backward compatible (even if this is a bad practice to use internal property)
any idea how to achieve this ?
Ilya Bylich
@iliabylich
Apr 13 2016 19:11
@Mogztter No, I think it's impossible
You can just use public methods :smile:
Guillaume Grossetie
@Mogztter
Apr 13 2016 19:22
Ok thanks
Forrest Chang
@fkchang
Apr 13 2016 22:35
@wied03 hmm, that's not quite what I saw, but might be related, /\s*([A-Z]\w*::(?:[A-Z]+\w*(?:::)?)*)+$/ acts different in 0.8 and 0.9, in 0.9 it does what I expect, but in 0.8 it's not "greedy enough" if I were to describe it in 2 words
@Mogztter I'd love updates on the progress as well as what you are doing or planning to be doing with it. I suspect server side opal on node could be quite useful in getting opal more widespread