These are chat archives for opal/opal

14th
Jan 2016
Elia Schito
@elia
Jan 14 2016 00:25
@jaredcwhite it's ok if I change the title to 0.9 instead of 0.9.2?
Jared White
@jaredcwhite
Jan 14 2016 00:26
@elia heh, I originally put 0.9 myself, and then thought maybe it wasn't accurate enough. so sure, that's fine with me :)
Martin Becker
@Thermatix
Jan 14 2016 12:55
is there an instance where a block do;end is not recognised as a block BUT is still parsed without errors?
Elia Schito
@elia
Jan 14 2016 13:45
@Thermatix what do you mean? CRuby or Opal?
@/all https://twitter.com/opalrb/status/687567542479622144 thanks again to @jaredcwhite
Martin Becker
@Thermatix
Jan 14 2016 13:51
opal
in the end I moved the functions args to variables and then passed the variables in and then it started working
Elia Schito
@elia
Jan 14 2016 13:53
@Thermatix please open an issue if it looks like some kind of bug and you have some code that can reproduce it! : )
Martin Becker
@Thermatix
Jan 14 2016 14:27
I don't know if I can get code to re-produce it
ylluminate
@ylluminate
Jan 14 2016 15:20
@elia what's been your thoughts on es6 so far?
Elia Schito
@elia
Jan 14 2016 15:21
hadn't the chance to try it enough
ylluminate
@ylluminate
Jan 14 2016 15:21
more and more discussion is going on with projects shifting over to es6 (eg, phaser 3 -> "lazer" pure es6)
Elia Schito
@elia
Jan 14 2016 15:22
do they use babel or rely on modern browsers only?
ylluminate
@ylluminate
Jan 14 2016 15:22
looking like babel for the time being
(i see a .babelrc in their root)
Elia Schito
@elia
Jan 14 2016 15:23
expected that, so in the end the still have raw JS…
ylluminate
@ylluminate
Jan 14 2016 15:24
that might present some peculiarities as far as debugging goes, but i've not even poked babel / es6 yet
Torstein Saltvedt
@saltvedt
Jan 14 2016 15:24
will opal compile to es6 somewhere down the road?
Elia Schito
@elia
Jan 14 2016 15:25
We thought about that, but for now there's seems to be no advantage in doing that (apart from being "cool" of course :P )
ylluminate
@ylluminate
Jan 14 2016 15:26
hmm. definitely something to think about
Elia Schito
@elia
Jan 14 2016 15:27
The way I look at ES6/Babel is that's still "just" another compile-to-JS language
ylluminate
@ylluminate
Jan 14 2016 15:27
right,
Elia Schito
@elia
Jan 14 2016 15:27
more interesting IMO would be to leverage stuff such as Set, Map and maybe Symbol, but that can't happen unless browser support is widespread enough
ylluminate
@ylluminate
Jan 14 2016 15:27
but if more and more projects shift to es6, the question becomes, what if we want to create es6 project wrappers
so we will need an es6 -> babel -> opal workflow
Elia Schito
@elia
Jan 14 2016 15:28
what do you mean by "project wrappers"?
ylluminate
@ylluminate
Jan 14 2016 15:29
reactrb, opal-phaser, etc.
Elia Schito
@elia
Jan 14 2016 15:29
so you mean using opal-phaser from an ES6/babel project or the other way around?
ylluminate
@ylluminate
Jan 14 2016 15:31
so let's just say phaser-3 (lazer) suddenly popped out the door and is pure es6 via babel. and we want to still write games / apps with ruby via opal-phaser (lazer)
thinking about the pipeline there
Elia Schito
@elia
Jan 14 2016 15:32
can't you get the compiled-to-js phaser-3 and use it from opal-phaser (just trying to understand how it works)
ylluminate
@ylluminate
Jan 14 2016 15:33
i'm assuming so, but then i was thinking about the inclusion of the original es6 src for debug. it's something we'll have to look at as time goes forward here i guess
Elia Schito
@elia
Jan 14 2016 15:38
keep me posted on your findings, maybe the solution for that is just to use sprockets tho
ylluminate
@ylluminate
Jan 14 2016 15:38
:thumbsup:
Torstein Saltvedt
@saltvedt
Jan 14 2016 16:19
is there any specific reason Range#step is not implemented? https://github.com/opal/opal/blob/master/opal/corelib/range.rb#L128
Ilya Bylich
@iliabylich
Jan 14 2016 16:28
@saltvedt No, it can be easily implemented. For now you can simulate it by converting your range to array
Of course, if your range is a range of integers
Torstein Saltvedt
@saltvedt
Jan 14 2016 16:30
simulate it how? (0..10).step(2).to_a blows up
not that it's hard to work around, just curios
Martin Becker
@Thermatix
Jan 14 2016 16:32
(0..10).to_a.step(2) ?
Ilya Bylich
@iliabylich
Jan 14 2016 16:33
As far as I remember, Array#step doesn't exist
(0..10).to_a.some_logic
Torstein Saltvedt
@saltvedt
Jan 14 2016 16:34
yeah, I'll just select by n % 2 == 0 or something
Ilya Bylich
@iliabylich
Jan 14 2016 16:35
You can try each_with_index.map { |item, index| ... }
Jamie Gaskins
@jgaskins
Jan 14 2016 18:39
@iliabylich Speaking of which, at one point, enum.map.with_index { |item, index| ... } used to work but it doesn't anymore. I keep forgetting to file an issue about it.
Elia Schito
@elia
Jan 14 2016 18:54
@jgaskins ಠ_ಠ →→→ ruby/spec
Elia Schito
@elia
Jan 14 2016 19:00
@jgaskins is enum a non-array?
>> [1,2,3].each.with_index {|n,i| p [n,i]}
[1, 0]
[2, 1]
[3, 2]
=> [1, 2, 3]
>> RUBY_ENGINE_VERSION
=> "0.10.0.dev"
>>