Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clojure.core/add-watch unimplemented #790

Closed
djblue opened this issue May 16, 2021 · 5 comments
Closed

clojure.core/add-watch unimplemented #790

djblue opened this issue May 16, 2021 · 5 comments
Labels
question General or specific question about Clojerl

Comments

@djblue
Copy link

djblue commented May 16, 2021

Hi,

In trying to port my library, portal, to clojerl, I noticed that add-watch isn't implemented. I get:

exception error: <<"unimplemented watches">>

I'm not familiar with erlang or beam so I was wondering, is this is a technical limitation or something that just hasn't been prioritized?

Also, this project is awesome, thanks for all the hard work!

@djblue djblue added the question General or specific question about Clojerl label May 16, 2021
@jfacorro
Copy link
Member

Hi @djblue 👋!

None of the libraries I have ported have needed them so far, so they haven't been a priority. But if there is interest in having them that can change 😄.

Issue #689 is meant to track the work for adding watches to reference types. As you can see in that ticket the current trade off is that watches would be added to atoms and agents but not to Vars. Would that work in your case? What reference type is using watches in your case?

Thank you for the question!

@djblue
Copy link
Author

djblue commented May 16, 2021

Thanks for the quick response @jfacorro! I would only need support for atoms at the moment so that shouldn't be a problem 👌 I use an atom to store a tap> list, then watch the atom to push updates to the client UI. I would also be curious if you had any interest in adding clojure.datafy and tap> to clojerl?

@jfacorro
Copy link
Member

jfacorro commented May 16, 2021

I would only need support for atoms at the moment so that shouldn't be a problem.

Awesome.

I would also be curious if you had any interest in adding clojure.datafy and tap> to clojerl?

I do 😄 . There are things missing from the latest Clojure release (i.e. 1.10) because I think I have only applied the changes up until 1.9 (but even from that version there are still some missing though).

Porting clojure.datafy seems straight-forward, although I think some thinking is needed since there are no objects on the BEAM. Clojerl has refied types (see erlang.Type module) and native types were given a name, all other type are implemented as tagged maps. There is something that can be done for this to work.

One aspect regarding tap> that would need some extra work is the fact that it uses a java.util.concurrent.ArrayBlockingQueue which has no equivalent in the BEAM and would need to be implemented from scratch using processes.

@jfacorro
Copy link
Member

I will create two new issues for bringing in the changes from 1.9 and 1.10 into Clojerl.

Would you be fine if we close this issue after that?

@jfacorro
Copy link
Member

Issues created #793 and #794.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question General or specific question about Clojerl
Projects
None yet
Development

No branches or pull requests

2 participants