-
Notifications
You must be signed in to change notification settings - Fork 8
any thoughts on how to interface to more complex values? #4
Description
I love that you did this and I think it's a pretty useful... I added String handling to it for a laugh.
Then I got to thinking... could I add more complex functionality? Say, an http request mechanism.
So I added an httpget implementation to the base environment, using Reqwest.
But that set me wondering further... my implementation of httpget is very blocking. But could the httpget return a function which would provide async access to the response?
(def r (httpget "https://google.com"))
(r "headers")
would produce the headers as a list or something, and:
(r "json")
would attempt to download the body (and cache it) and convert to json... etc...
This returning closures from Risp functions would be cool but I started to fall over my Rust knowledge... I know how to do this in C but I can't see how to return a function from here that would close a non-cloneable value like a reqwest response.
This is going to be the case with a lot of systems programming like things... file descriptors etc... are all non-clonable.
If you don't mind me asking, how would you do this?