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

Generate wolfram.clj with vars for Wolfram symbols #55

Merged
merged 12 commits into from
Jun 29, 2024

Conversation

holyjak
Copy link
Member

@holyjak holyjak commented Jun 21, 2024

  • Introduce wolframite.impl.wolfram-syms.* for dealing with interning wolfram symbols, move intern and load-syms there
  • Add ...write ns to write wolframite/wolfram.clj with defs of the loaded symbols (to be included in git and used as a starting point by users, unless they decide to re-write it)

Fixes #33, #45, #53

* Introduce wolframite.impl.wolfram-syms.* for dealing with interning wolfram symbols, move intern and load-syms there
* Add ...write ns to write wolframite/wolfram.clj with defs of the loaded symbols (to be included in git and used as a starting point by users, unless they decide to re-write it)
@holyjak holyjak marked this pull request as draft June 21, 2024 12:12
@holyjak

This comment was marked as resolved.

@holyjak
Copy link
Member Author

holyjak commented Jun 28, 2024

TODO

  • Update the docs, mention how to re-create the w ns
  • mention wolfram-version, write-ns!, to 'resolve as fn' for w/fn, ...
  • Log warning of user has newer Wolfram
  • Verify write-ns! works when used in a project that has Wolframite as its library
  • kondo config for w/fn

* Add wolframite.wolfram/fn as replacement for clj's fn in wolfram expressions - defined in a helper ns, which we read and dump into the generated wolf. ns
* Correctly turn var-as-value into a symbol (i.e. not a fn call such as (w/Plus ..) but a value such as `... w/$VersionNumber ...`
* Add core/kernel-info! fn, use it
* Add tests for wl/eval with wolf vars
* Add w/*wolfram-kernel-name*
@holyjak holyjak marked this pull request as ready for review June 28, 2024 16:44
@holyjak holyjak force-pushed the fix-45-compose-wolf-expressions branch from 26b54db to abbac0b Compare June 28, 2024 17:11
@light-matters
Copy link
Contributor

Thoughts on kernel-info!

As far as I can see it's not side-affecting and so shouldn't have an exclamation mark?
Since it's just returning data on the system then it goes well with similar functions in runtime.system (rather than in core)?

@light-matters
Copy link
Contributor

  • Working through the getting started seems to work.
  • Docstrings appear in emacs minibuffer while typing out functions (w/N w/PI) etc.
  • 'normal' autocompletion didn't seem to work, but after some delay (I was on the phone for five minutes) it seems to work well.

@light-matters
Copy link
Contributor

light-matters commented Jun 29, 2024

I really like that I can now do things like

 (-> 'x
    (w/Integrate 'x)
    wl/eval)

i.e. don't have to deal with macros and symbols not playing well with functions.

@light-matters light-matters merged commit 39789bb into main Jun 29, 2024
@light-matters light-matters deleted the fix-45-compose-wolf-expressions branch June 29, 2024 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Find out if we can get autocomplete support with loaded Wolf symbols in Calva/Cursive/Emacs
2 participants