Replies: 5 comments 6 replies
-
|
Here are some possibly relevant bits: As to whether something is a cfunction, I think one may be able to use Also, the |
Beta Was this translation helpful? Give feedback.
-
|
A cfunction is a binding from Janet to a function implemented in C. Most interpreted languages have that sort of construct, it varies in if they expose that in the type system or not. JavaScript on Chrome used to indicate if a function was "native" or composed via JS I can't speak for Janet abstract types in detail, but I saw a comment about them being similar to a Lua userdata. As far as categories of types, I'd suggest that you could break types in Janet into values and containers. Values would be integers, books, and symbols. Containers would be more like tables, structs, arrays, tuples and buffers. A string is the hybrid between the two, containing bytes, but usually considered as a value, and immutable. But, for now, bakpakin is the ultimate authority on this. I do like that every container type has a mutable and an immutable version. It provides a nice symmetry. |
Beta Was this translation helpful? Give feedback.
-
|
I did notice that maybe there aren't clear 'categories' of types in Janet. For what it's worth: Common LISP has "ATOM' to distinguish between atomic and compound (list) data. Perhaps there should be a function And on this same topic -- anyone notice that Janet's Mike |
Beta Was this translation helpful? Give feedback.
-
|
I see that I'd always thought of "idempotent" to mean a "pure" (side-effect free) function. |
Beta Was this translation helpful? Give feedback.
-
|
Ok, I think then the terms I was looking for were recursive (tuples, arrays, structs, tables) vs non-recursive (possibly aka "atomic") (symbols, keywords, strings, buffers, edit: booleans too). And it's interesting to see the other categorizations:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
What are the types of things in Janet called? As in, you have simple objects like
1,5.2,true,:this-and-that, and symbols, but also compound objects like@[1 2]. Maybe the latter are just referred to as "data structures"? But what are the former called?In chat it was pointed out to me that there's an
idempotent?function that seems to suggest maybe the term "atomic" for these simple objects?It was also pointed out to me by @sogaiu that the types of things in Janet are listed right at https://github.com/janet-lang/janet/blob/master/src/include/janet.h#L399-L416.
The discussion began getting deeper, touching on
function?,cfunction?, and abstract types.Are cfunctions functions in Janet that are implemented in C? Which ones are these?
What are abstract types in Janet?
Beta Was this translation helpful? Give feedback.
All reactions