chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch for "bind" egg: support for modern C++ nested namespace definition


From: Florian Keßeler
Subject: Patch for "bind" egg: support for modern C++ nested namespace definition and scoped enums
Date: Sat, 29 Jan 2022 01:42:24 +0100

Hi all,

I hope this is the right place to send this to, but here we go. For our project, we wanted support for some modern C++-features in the "bind" egg:

1. nested namespace definitions: instead of namespace A { namespace B {
   ... } }, C++17 allows writing namespace A::B { ... }
2. typed and scoped enums: C++11 allows specifying the underlying type
   of an enum: enum C: int16_t { ... }. It also added scoped enums,
   that put all enumerators into a new scope: enum class D { E, F },
   which then need to be referenced as D::E and D::F.

Since bind is a thin layer over some basic C and C++ constructs and mostly ignores namespaces, I've extended it to accept nested namespace definitions and scoped and typed enums. The underlying type for the latter are simply ignored by bind as well.

These changes would really help reusing declarations between C++ code called by CHICKEN and bindings automatically generated with the bind module and chicken-bind CLI tools.

Disclaimer: Even though I have almost 20 years of professional coding experience, I'm still pretty new to both Scheme and Lisp in general. Feedback of any kind is welcome!


Cheers
- rnlf

Attachment: chicken-bind-nested-namespaces-scoped-enums.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]