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
Hans Elias J.
@hansihe
the virtual field will get it's value from the tag of the union
William Gaylord
@wgaylord
so I will rest my case you your making the Json its own thing that will take a while to learn.
Hans Elias J.
@hansihe
when reading the type, the union will get its value from the virtual field
Robin Lambertz
@roblabla
erm, I meant { ref, prop, type } up there
@chibill we're adding new concepts to protodef. It's obvious that will go in the JSON as well.
William Gaylord
@wgaylord
also you seem to be making the JSON files bigger with out adding anything new to them. Just changing how they work....
Robin Lambertz
@roblabla
The whole idea of the JSON is that it's easier to work with because you don't have to write your own parser and w/e
Hans Elias J.
@hansihe
chibill: what I did was remove hacks that only worked for some special cases and replaced them with more general and expandable mechanisms
case in point, mapper and switch
William Gaylord
@wgaylord
I have no idea why mapper ever existed when you could have just used a switch to do that same job...
Hans Elias J.
@hansihe
both of which were relatively specific, only used in some cases, interacted with each other in a complex way
you can't
that's the point
union is more flexible
it replaces them both
Robin Lambertz
@roblabla
@chibill we needed to put a string in the container to get the name of the packet
We already had switch
The idea was that mapper takes the packet ID and turns it into a packet name
Hans Elias J.
@hansihe
same with the count mechanism in array and buffer
Robin Lambertz
@roblabla
while switch takes the packet ID and figures out what packet type to read from it
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?