Coder Social home page Coder Social logo

native-packing-raku's Issues

inheritance mishandled

A first attempt at basic inhertance:

use Test;
use Native::Packing :Endian;
plan 1;

class BaseStruct {
        has uint16 $.a;
        has uint8  $.b;
}

class Struct is BaseStruct does Native::Packing[Network] {
    has uint16 $.c;
}

my $s = Struct.new: :a(42), :b(99), :c(69);
my $n-buf = $s.pack;
is-deeply $n-buf.list, (
    0,42,
    99,
    0,69), 'network packing with inheritance';

done-testing;

The above test should pass if the storage a, b (from the base class) then c, but the test fails with:

1..1
not ok 1 - network packing with inheritance
# Failed test 'network packing with inheritance'
# at t/inheritance.t line 17
# expected: $(0, 42, 99, 0, 69)
#      got: $(0, 69, 0, 42, 99)
# You failed 1 test of 1

Which indicates we're currentl;y getting c, a, b.

"Little Endian" and "Big Endian" swapped in README.md

Hi! The current formulation in README.md is:

The two fixed modes are:

  • Vax (big endian) - least significant byte written first
  • Network (little endian) - most significant byte written first

The "big endian" and "little endian" strings are swapped, it should be:

The two fixed modes are:

  • Vax (little endian) - least significant byte written first
  • Network (big endian) - most significant byte written first

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.