qitab / cl-protobufs

Common Lisp protocol buffer implementation.
MIT License
82 stars 17 forks source link

How/Should one load the generated lisp file? #326

Closed dmsurti closed 3 years ago

dmsurti commented 3 years ago

Referring to the math example; I assume we would:

My question is: does one need to explicitly load the math.proto.lisp or not? How would math.lisp work without loading the generated lisp file?

When I try to load the generated lisp file, get a package error:

* (load "/tmp/math.proto.lisp") 

 The name "CL-PROTOBUFS.IMPLEMENTATION" does not designate any package.
cgay commented 3 years ago

The generated file depends on cl-protobufs so you need to have already loaded the cl-protobufs code into your image before loading the generated code. See https://github.com/qitab/cl-protobufs/blob/master/README.md#asdf for the usual way to do that.

dmsurti commented 3 years ago

@cgay Thanks, I looked at the examples and found that I can use protobuf-source-file in the system def. I adapted from the extend-test example as I had a proto file import another one.

I am closing this issue and will try submit a patch with an updated README and examples modified as I believe that is the correct idiomatic usage. Kindly correct if I am understanding the usage wrong.