Comments (6)
I created an executable script called fsx
:
dotnet fsi --exec "$@"
And I have added it to the PATH. This works because panda adds then the .fsx
extension to the file. But it feels somehow wrong to me.
from panda.
I guess this is due to an old Microsoft convention to define the file type according to its file extension. On Unix/Linux, the file type is given by the file content which is way simpler.
Panda has a very bad heuristic to guess the appropriate extension that may only work for cmd.exe
(the extension is the name of the interpretor without its extension (cmd.exe
-> .cmd
).
I can change this "heuristic" by an easier one. For diagrams, the image extension can be explicitly given in the command (e.g. %o.png
).
Then it would be possible to write {.fsx cmd="dotnet fsi %s.fsi" }
(%s.fsi
would be the name of a temporary file with the extension .fsi
).
from panda.
Yes! I like that idea.
FTR: F# inherited these conventions from OCaml so, this time is not MS.
Update: ocaml scripts work okay regardless of the extension so, it is MS
from panda.
I pushed a small update with explicit extension in the command line and a few predefined extensions.
{cmd=python}
is equivalent to {cmd="python %s"}
and {cmd="python %s.py"}
Some extensions are predefined too for Python, Lua, shell scripts, cmd for Windows and F#.
I.e. {cmd="dotnet fsi"}
is equivalent to {cmd="dotnet fsi %s"}
and {cmd="dotnet fsi %s.fs"}
.
from panda.
Tested. Just a clarification: the extension for f# scripts is .fsx
(.fs
is also a f# extension but for files that are part of a project) so, i think it would be better to change. Anyway, this is much better now and this works excellently:
```{.fsx icmd="dotnet fsi --exec %s.fsx" } open System Console.WriteLine("Thank you @CDSoft!"); ```
from panda.
Ok, I'll fix the .fsx extension.
from panda.
Related Issues (11)
- current file as environmental variable HOT 3
- Variable expansion doesn't work on `include` HOT 2
- gnuplot diagrams are not rendered HOT 2
- error when reading boolean metadata HOT 1
- Variables don't expand unless delimited by spaces HOT 4
- Shell commands don't work on Windows HOT 6
- 'title' parameter of 'render' block should be caption of included diagram HOT 6
- Add 'caption="string"' and header=true/false options to include block HOT 3
- Conditionals only work when in separate paragraphs. HOT 3
- Highlight code block HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from panda.