On Sun, Jan 3, 2016 at 8:36 AM, Emmanuel Charpentier <emanuel.charpent...@gmail.com> wrote: > Dear Volker, > > Le dimanche 3 janvier 2016 16:33:36 UTC+1, Volker Braun a écrit : >> >> On Sunday, January 3, 2016 at 2:41:51 PM UTC+1, Emmanuel Charpentier >> wrote: >>> >>> "other language" cells : %maxima and %r (possibly other interpreters such >>> as %octave) do not work as expected. Both %maxima and %r open new instances >>> of their respective interpreters and enter an REPL that cannot be exited >>> (even with an explicit "quit();" or "q('no')". In other words, they never >>> return >> >> Interactive line magics obviously can't work in the browser like on the >> command line >> >> >> The lack of appropriate cell magics (%%maxima) is just an existing bug on >> the commandline. > > > Indeed. We should have %%maxima, %%r , %%pari, etc... > > [ BTW : that's not really a bug, but rather a design conflict : the original > %mode functions were designed to switch (for an indefinite scope) the > behaviour of the REPL.This was transposed in the Sage notebook as what > amounts to the equivalent of Jupyter's cell magics (scope defined as the > current cell). Whereas line magics are, as far as I understand, > Jupyter-specific... We can't be consistent across notebooks without > redefining our "mode switch" magics as "cell magics", and rename them with > "%%"... ]
In case you are curious, in SageMathCloud worksheets a line mode is %foo <stuff on the line> and a cell mode is %foo(optional, arguments) <rest of the cell> In SMC %foo is just foo('... rest of line or cell...'), with some optional hooks (e.g., support foo.eval for backwards compat with sage). So a "magic" is much less magic -- just define any function that takes a string as input, and you've written one. I don't use %% anywhere. I don't care what you do with Jupyter, but I'm sticking with this design for cell modes, and definitely won't change. -- William -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.