GithubHelp home page GithubHelp logo

Comments (9)

jangko avatar jangko commented on May 30, 2024 1

change var MsgStream to MsgStream of unpack_type and pack_type

proc unpack_type*(ss: msgpack4nim.MsgStream, x: var str9) =
  var str: string
  msgpack4nim.unpack(ss, str)
  copyMem(addr x[0], addr str[0], 9)

proc pack_type*(ss: msgpack4nim.MsgStream, x: str9) =
  let str: string = tostring(x)
  msgpack4nim.pack(ss, str)

proc pack_type*(ss: msgpack4nim.MsgStream, x: binaryheap.Heap[mytuple]) =
  let xseq: seq[mytuple] = sequtils.toSeq(binaryheap.items(x)) # unsorted
  msgpack4nim.pack(ss, xseq)

from msgpack4nim.

pb-cdunn avatar pb-cdunn commented on May 30, 2024

You seem to have a circular dependency between 4nim and 4collection. Is that the problem? Is that interacting with the "" style of import (which I need)?

#24

from msgpack4nim.

pb-cdunn avatar pb-cdunn commented on May 30, 2024

If I skip the "4collection" import, I get this shorter stack-trace:

falcon/rr_hctg_track.nim(414, 19) template/generic instantiation from here
../repos/msgpack4nim/msgpack4nim.nim(1069, 53) template/generic instantiation from here
../repos/msgpack4nim/msgpack4nim.nim(727, 32) Error: undeclared field: 'data'
          s.pack_type undistinct(field)
                                 ^

from msgpack4nim.

pb-cdunn avatar pb-cdunn commented on May 30, 2024

I am serializing (i.e. "packing") myprioritytable:

 29 type
 30   # A ctg is a 9-char array.
 31   str9 = array[0..9, char]
 33   mytuple = tuple[score: int, rid: str9] #overlap_len, q_id
 35   myprioritytable = tables.Table[string, binaryheap.Heap[mytuple]]

from msgpack4nim.

pb-cdunn avatar pb-cdunn commented on May 30, 2024
-import "../msgpack4nim/msgpack4nim.nim"
-import "../msgpack4nim/msgpack4collection.nim"
+import ../msgpack4nim/msgpack4nim
+import ../msgpack4nim/msgpack4collection

Same problem that way.

from msgpack4nim.

pb-cdunn avatar pb-cdunn commented on May 30, 2024

I cannot use nimble because I have restrictions from my company. I use a directory structure like this:

src/fc_consensus.nim
src/falcon/rr_hctg_track.nim
src/msgpack4nim/
src/nim-heap/

src/fc_consensus.nim:

from falcon/rr_hctg_track import nil

src/falcon/rr_hctg_track.nim:

import ../msgpack4nim/msgpack4nim
import ../msgpack4nim/msgpack4collection
from "../nim-heap/binaryheap" import nil

from msgpack4nim.

jangko avatar jangko commented on May 30, 2024

your nim version and some of your submodules seems outdated. but hey, we are using nim. nim evolves quickly. :)

from msgpack4nim.

pb-cdunn avatar pb-cdunn commented on May 30, 2024

0.19.4. Should I use devel?

from msgpack4nim.

jangko avatar jangko commented on May 30, 2024

0.19.0 is enough

from msgpack4nim.

Related Issues (20)

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.