Replies: 2 comments
-
As an example of one place metadata is used, please see this example code from spork. Perhaps worth digesting at some point is this PR that enhanced some of the metadata capabilities. |
Beta Was this translation helpful? Give feedback.
-
It might be helpful to look into ways that metadata is used in Clojure, or how property lists are used in Common Lisp. The only time I have used metadata is for Judge's Since metadata is a property of an environment entry, not of a value, you're kind of limited in what you can do with it -- you can only get it through an environment, and there's no built-in way to pass a function and its metadata to another function, for example. I would be interested to hear about cases where you've wanted to reach for metadata in the past. Maybe it's a great fit! |
Beta Was this translation helpful? Give feedback.
-
I would like to better understand the design and imagined use cases for Metadata in Janet, especially from @bakpakin 's perspective.
I've wondered a couple of times whether metadata might be helpful for solving some problem or other, but I'm never quite sure whether what I'm trying to do is reasonable, or shall we say "idiomatic," as opposed to "hacky work-around with obvious, extremely preferable alternatives." But there isn't much in the documentation about metadata. And when I've given programming with it a try, I haven't always gotten the behavior I was expecting.
@bakpakin , do you use metadata for anything when writing your own libraries or programs in Janet? Do you envision it being used for any particular use cases? Do you consider writing programs that interact with metadata "well supported" by the language in general, or should I be thinking about it more like a hack that could technically work but isn't necessarily recommended?
Does anyone (@bakpakin or anyone else) have experience working with metadata, have advice or recommendations to share (especially when it comes to identifying cases when metadata is a good tool to reach for), or know of any examples in the wild that are making good use of metadata that I could baseline my understanding off of?
Beta Was this translation helpful? Give feedback.
All reactions