kevinlawler / kona

Open-source implementation of the K programming language
ISC License
1.36k stars 138 forks source link

how to add new data type, such as datetime? #546

Closed fouvy closed 5 years ago

fouvy commented 5 years ago

I wanna add some new date type, any doc about add new data type?

tavmem commented 5 years ago

If you want to add some new data type within Kona, you can setup a function to do that. For example, if you want to add datetime:

  _ltime _t
20190705 205947

datetime:{_ltime _t}
  datetime()
20190705 210106

If you want to add some new data type to the underlying C code: All the datatypes are defined in src/ts.h