这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@jonsequitur
Copy link
Contributor

This enables the directive APIs to implement IPython-style magic commands.

I've changed the experimental #kernel csharp directive to be a cell-scoped language selector, enabling, e.g.:

%%csharp

var x = 123;

In this example "csharp" is actually the subkernel name, so this particular magic will be enabled automatically when a kernel is added to the CompositeKernel.

@jonsequitur jonsequitur force-pushed the magic branch 3 times, most recently from 286e2fb to 39168c2 Compare August 23, 2019 23:48
@jonsequitur jonsequitur changed the title [WIP] Magic Magic Aug 23, 2019
@jonsequitur
Copy link
Contributor Author

jonsequitur commented Aug 23, 2019

%lsmagic illustrates the structure of nested subkernels and some of the implications of extending specific subkernels versus extending the CompositeKernel.

image

{
public static class KernelExtensions
{
public static void VisitAllSubkernels(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should VisitAllSubkernels be a recursive function that performs the same thing for all the subkernels of each subkernel ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I'll fix this.

@jonsequitur jonsequitur force-pushed the magic branch 3 times, most recently from 1b4f441 to 792670f Compare August 27, 2019 15:14
@jonsequitur jonsequitur merged commit 905d609 into dotnet:master Aug 27, 2019
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.

4 participants