Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

With D it is:

    import sqlite3;
This causes sqlite3.h to be read, lexed, parsed, and semantically analyzed to convert (where possible) C symbols to D symbols, and makes them available to the importer.

I've been sometimes pressured to instead use various more complicated syntaxes, but have held the line :-)



What i like to use is to isolate the imports from C, since they usually come with other definitions wich might clash (already defined error thingy):

    import c = sqlite3;
On that topic, i wish it was possible to group named imports, perhaps this way:

    import c = sqlite3, miniz;




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: