Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Mar 12 10:08
    SuperOP535 closed #92
  • Jan 13 21:26
    rom1504 commented #95
  • Jan 13 18:12
    rom1504 opened #96
  • Jan 13 18:11
    rom1504 opened #95
  • Nov 29 2018 20:42

    rom1504 on master

    Change some functions to arrow … (compare)

  • Nov 29 2018 20:42
    rom1504 closed #94
  • Nov 29 2018 20:33
    SuperOP535 synchronize #94
  • Nov 29 2018 20:31
    SuperOP535 synchronize #94
  • Nov 29 2018 20:29
    SuperOP535 opened #94
  • Nov 29 2018 18:31
    SuperOP535 closed #93
  • Nov 29 2018 08:56
    SuperOP535 opened #93
  • Nov 25 2018 15:53

    rom1504 on master

    update chat badges (compare)

  • Nov 15 2018 13:29
    SuperOP535 opened #92
  • Nov 15 2018 13:23
    SuperOP535 commented #75
  • Nov 15 2018 11:18
    rom1504 commented #75
  • Nov 15 2018 10:18
    SuperOP535 commented #75
  • Nov 13 2018 01:17
    rom1504 commented #75
  • Nov 12 2018 23:19
    rom1504 closed #85
  • Nov 12 2018 23:19
    rom1504 commented #85
  • Nov 12 2018 23:19

    rom1504 on master

    Added LICENSE file (compare)

Hans Elias J.
@hansihe
that could work in 3 different ways, depending on what arguments you give it
those 3 ways has been replaced with a single way which manages to be generic and not much more verbose
William Gaylord
@wgaylord
switch takes a type and compares it to decide what to do. Mapper takes a type and compares it to decide what to output sounds exactly the same....
waht ever.
Hans Elias J.
@hansihe
yeah. what ever.
it's not though
William Gaylord
@wgaylord
the fact that everything I was working on will be trash pisses me off.
Robin Lambertz
@roblabla
eeh, actually he does have a point. We might've been able to make something better by just creating a "const" type
Hans Elias J.
@hansihe
well, the point of mapper is that it's two way
that's the whole trick of it, if I remember right
William Gaylord
@wgaylord
mapper is one way according to the docs.
Robin Lambertz
@roblabla
@hansihe so for arrays, we could do
def("test") => container(virtual: "true") {
    virtual_field("count", ref: "data", prop: "count") => u64;
    field("data") => array(type: "u8")
}
or something like that ?
Also, what does virtual really do on container ?
William Gaylord
@wgaylord
But I have learned to not trust the docs but this time the Node version agrees.
Hans Elias J.
@hansihe
sorry, I don't quite understand
what do you intend the type: "u8" to do here?
Robin Lambertz
@roblabla
the array's content
This would create an array of bytes
William Gaylord
@wgaylord
what about the array's size?
ohh nvm
Robin Lambertz
@roblabla
that's what the virtual_field does
Hans Elias J.
@hansihe
roblabla: I fail to see why you would specify the inner type like that
William Gaylord
@wgaylord
because you have to...
Hans Elias J.
@hansihe
why not field("data") => array() => u8
no
Robin Lambertz
@roblabla
oh
true, my bad
I'm thinking in terms of the old json format XD
Hans Elias J.
@hansihe
so what you mean is that the array should resolve the reference the other way automatically?
William Gaylord
@wgaylord
I will just say this again.
Hans Elias J.
@hansihe
I opted to mark it manually because I usually like making things explicit
over implicit
William Gaylord
@wgaylord
mapper is one way according to the docs.
But I have learned to not trust the docs but this time the Node version agrees.
as no one said anything.
Robin Lambertz
@roblabla
@chibill IDK. No one knows. I don't remember how mapper works, I'd need to dig into the source code of the mapper datatype. And I'm not too interested in knowing.
Mapper sucks and should die :P
@hansihe aaah I see. I missed the ref somehow
Makes sense now
Hans Elias J.
@hansihe
chibill: mapper is two way. it maps a string to a constant
Robin Lambertz
@roblabla
Last question : what does virtual do in containers ? Is it to signify that it contains virtual fields ?
William Gaylord
@wgaylord
so why is it not that way in the impl? or is JS goofy syntax messing me up......
Hans Elias J.
@hansihe
so when reading it could take 0 and map it to something like "packet_read"
when writing it would take "packet_read" and map it to 0
switch is not capable of doing that
Robin Lambertz
@roblabla
It could
NVM
it can't.
My brain is not working
Hans Elias J.
@hansihe
roblabla: when a container only has a single non-virtual field in it, you can mark the container as virtual