fsprojects / IfSharp

F# for Jupyter Notebooks
Other
442 stars 71 forks source link

Add IFSHARP define #188

Closed dsyme closed 6 years ago

dsyme commented 6 years ago

It is reasonable for load scripts to configure themselves based on host. We already have HAS_FSI_ADDHTMLPRINTER, and it is better to use host capabilities like this, but also having a host define is sensible.

dsyme commented 6 years ago

Maybe this should be HOST_IFSHARP or HOST_JUPYTER though there is no standard for such things

cgravill commented 6 years ago

This is for interacting with https://github.com/fsprojects/Paket/issues/3325 ?

I'm fine with adding this define if it helps.

It's a shame there isn't a Jupyter convention to follow on this one. There's some discussion how to do it here: https://stackoverflow.com/questions/15411967/how-can-i-check-if-code-is-executed-in-the-ipython-notebook where the most direct equivalent would be:

System.AppDomain.CurrentDomain.GetAssemblies() |> Seq.exists(fun assembly -> assembly.FullName.Contains("ifsharp"))
dsyme commented 6 years ago

This is for interacting with fsprojects/Paket#3325 ?

Yep, thanks :)

I also added JUPYTER - I think this is now ready