GithubHelp home page GithubHelp logo

ob-magma's Introduction

Warning

This package is by no means ready for production use. I have stopped working on it in the spring of 2015, so I may not be able to provide support. But please, if you test it and encounter issues, feel free to post them here for reference.

If someone is wishing to pursue developing this package, I will be glad to help to my best capacity.

Magma in org-babel

Basics

This package provides support for magma evaluation with org-babel. Evaluation is made in a unique magma session, explicit naming of sessions is possible.

Results type can be either ‘output or ‘value, in which case magma tries to determine whether the output is a table or not. If your output is a sequence and you do not wish to format it as a table, use ‘output for this code block.

Tne parameter :magma-eval t causes the block to be enclosed in an eval form. The output value is given by the return statement. At the moment, nothing is done to suppress other forms of output. This evaluation method corresponds to 'value for most other modes, but due to limits with magma eval (for example, no side effect is possible), making it the default would be counter-intuitive.

This package is intended to be used with the magma-mode available here, but in theory, it could work with any magma-mode providing a function magma-run (&optional session) creating a magma interactive buffer and returning it. The function may disregard the session argument, in which case the :session parameter of org will have no effect.

Examples

(Please see the readme in raw org form for the results of the examples)

Results are handled as string by default:

print(3+3);
print(x+3);

If the result is a sequence, it is returned as a org table.

print([[1,2,3],[4,5,6],[7,8,9]]);

If this is unwanted, use the :results output parameter.

print([[1,2,3],[4,5,6],[7,8,9]]);

A special evaluation method is given by the :eval parameter. In this setting, all code is wrapped in an eval form, and evaluated. The code block should have a return statement and avoid printing overall (this will be fixed in the future).

x := 3;
y := 4;
return x + y;

Finally, session-based evaluation is also supported:

x := 3;
print x;
x := 4;
print x;
print x;

ob-magma's People

Contributors

thibautverron avatar

Stargazers

Eloi Torrents avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.