Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 16:35
    rom1504 commented #97
  • 16:33

    rom1504 on master

    Release 1.6.10 (compare)

  • 16:31

    rom1504 on master

    add gitpod and fix gitmodules (compare)

  • 16:29
    rom1504 closed #65
  • 16:29
    rom1504 commented #65
  • 16:28
    rom1504 closed #53
  • 16:28
    rom1504 commented #53
  • 16:28
    rom1504 closed #52
  • 16:28
    rom1504 commented #52
  • 16:27
    rom1504 closed #51
  • 16:27
    rom1504 commented #51
  • 16:26

    rom1504 on master

    Fixed issue #97 Merge pull request #97 from mrc… (compare)

  • 16:26
    rom1504 closed #97
  • 15:58
    mrcrille commented #97
  • 15:23
    mrcrille commented #97
  • 15:20
    mrcrille commented #97
  • 15:18
    mrcrille opened #97
  • 15:11
    rom1504 commented #97
  • 15:06
    mrcrille opened #97
  • Mar 12 10:08
    SuperOP535 closed #92
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
that removes the container from the output, the single non-virtual field replaces it in the serialized/deserialized data
Robin Lambertz
@roblabla
ah, so it's like the old anon ?
William Gaylord
@wgaylord
but would the non-virtual field not then be virtual? Unless there is a non-virtual tag or something on the field....
Robin Lambertz
@roblabla
kinda sorta
Hans Elias J.
@hansihe
no, not really
well, the other way around kinda
Robin Lambertz
@roblabla
hmm, yeah I get it
Hans Elias J.
@hansihe
it's a way of defining something like a length prefixed array type without specific built in language features
William Gaylord
@wgaylord
how does it know that the field is not virtual along with the container?
Hans Elias J.
@hansihe
it just helps with composability really
Robin Lambertz
@roblabla
@chibill virtual just means you don't provide it data directly