Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add data type mapping between FFI and Lua values #1059

Merged
merged 5 commits into from Mar 6, 2017

Commits on Nov 3, 2016

  1. Add data type mapping between FFI and Lua values

    From the README:
    
      Ever been annoyed that you can't create a hash table where the keys are
      FFI values, like raw IPv4 addresses, but the values are Lua objects?
      Well of course you can key a normal Lua table by any Lua value, but the
      key is looked up by identity and not by value, which is rarely what you
      want.  `foo[lib.protocol.ipv4:pton('1.2.3.4')]` will not be the same as
      `foo[lib.protocol.ipv4:pton('1.2.3.4')]`, as the `pton` call produces a
      fresh value every time.  What you usually want with FFI-keyed tables is
      to be able to look up the entry by value, not by identity.
    
      Well never fear, *cltable* is here.  A cltable is a data type that
      associates FFI keys with any old Lua value.  When you look up a key in a
      cltable, the key is matched by-value.
    wingo committed Nov 3, 2016
    Configuration menu
    Copy the full SHA
    68b6498 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2016

  1. ctable: hash_fn param is optional

    If no hash_fn is given, ctable will provide one.
    wingo committed Nov 4, 2016
    Configuration menu
    Copy the full SHA
    0e95eea View commit details
    Browse the repository at this point in the history

Commits on Nov 7, 2016

  1. Configuration menu
    Copy the full SHA
    1a28ca7 View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2016

  1. Configuration menu
    Copy the full SHA
    9309f35 View commit details
    Browse the repository at this point in the history
  2. Add iteration test of cltable

    wingo committed Nov 8, 2016
    Configuration menu
    Copy the full SHA
    d64e70d View commit details
    Browse the repository at this point in the history