Include files in an FSX file? - f#

I use F# as a scripting language with FSI. Is there a way to include another fsx file in my script? I want to be able to break my scripts into multiple files for larger tasks.
Thanks.

If I understand the question correctly, you should be able to use the #load directive to do what you want. See http://msdn.microsoft.com/en-us/library/dd233175.aspx.

Related

Running a Rascal program from outside the REPL

I'd really like to be able to run some Rascal's program from outside the REPL (e.g. as part of a script, or called from another program). What I'm using Rascal for is and intermediate stage in a larger framework so I am wondering what the best way to go about integrating executing the Rascal code from another program.
Right now the best way is to package your code together with the Rascal shell executable jar. There is a convenience class JavaToRascal for calling into Rascal code. Sometimes it requires some thinking to add your own modules to the Rascal search path using IRascalSearchPathContributors, but if you include a RASCAL.MF file with the right properties it all should go automatically.
If you are thinking of an Eclipse plugin, then the best way is to let your plugin depend on the rascal-eclipse plugin and use ProjectEvaluatorFactory to get access to the interpreter.
Caveat: since we are moving to a compiled system, the code you write for this kind of integration will change. This is the reason we haven't documented the API for calling Rascal from Java yet.
As I was pondering the same question, this is the (maybe trivial) answer I came up with:
java -jar /path/to/rascal-shell-stable.jar path/to/myProgram.rsc
You have to be aware that Rascal calculates module names from the current directory (don't know if it supports something like Java's CLASS_PATH), so in the above example myProgram.rsc should have a module declaration of module path::to::myProgram. Calculated and declared module name have to match.

F# FAKE Get script directory

Is there an easy way for me to get the path of the executing .fsx file using FAKE? Powershell and (psake) by nature of its use and MSBUILD provide this functionality but as FAKE/F# a noob it is not immediately apparent how to do this.
Try __SOURCE_DIRECTORY__ or
__SOURCE_FILE__.
It should work like in every other F# script file see F# for scripting: location of script file.

How to include required files for a Jenkins Job (Delphi)

As stated in my title, basically I'm struggling on how to go about to include required files for a Delphi program to compile. I'm experimenting with Jenkins and using the execute Windows batch command for building the Delphi program (Delphi 2006 is used). It would be nice if there is some sort of generic method to find/include the required files since including it manually defeats the point of automation. Does anyone have experience with this? Or maybe know a script or batch that can include the needed files?
Thanks in advance if anyone can help!
When you use dcc32.exe directly, be sure, that all required include paths are set correctly in dcc32.cfg (-I). See here.Another option would be to use msbuild to build your projects.

Generate Javadoc for just interfaces using Ant?

I am using Apache Ant to generate Javadoc for my program which has many projects (or modules). However, I want to generate Javadoc for Interfaces only, and I do not know how to check if a file is a class or interface in Ant. Someone suggested me that I should use <fileset> and specify a list of files to exclude or include. However, there are hundreds of files in my program and specifying a list of class files to exclude is impossible.
Does anyone have some ideas, please?
I don't believe this is possible unless you write your own custom ant-task, (which wouldn't be that hard actually) and reference that in your Ant-script.
Another, (much uglier) way would be to generate the complete java-doc and remove non-interface files. These could for instance be identified by looking at the allclasses-frame.html:
ComponentView
<I>Composite</I>
where you have both the type (in the title=...) and file (href=...) available.
Have you considered writing your own doclet? Instead of trying to get ant to do the work, create a doclet that knows how to discard every non-interface. Then, using the javadoc task in ant is simple.
Hope that helps.

foreach Loop in LaTeX

Scenario: I have a main Latex file (main.tex) in which I include a subfile (appendix.tex) using the subfiles package.
Role of appendix.tex: It further includes all the appendices as subfiles kept in an appendix subfolder, so that I just need to include the appendix.tex in the main.tex file.
Current Situation: I have to manually list the appendices in appendix.tex which can be cumbersome to manage.
Target: I want to create a foreach loop kind of thing in the appendix.tex file such that it looks in the appendix subfolder and includes each of the .tex files present in it.
Question: How can this be done?
This can be relatively easy implemented with python.sty from here. This would require you to make sure that the style file and python is available on all machines were you plan to compile this document, but should be more portable than using shell scripts or preprocessors like cpp.
Probably easiest done externally via a shell script. Provide some more info on your OS (Win/Apple/Linux) and someone will no doubt provide the necessary script.
I did it the other way, with a python pre-processor for LaTeX. My preprocessor generates tables and allows raw python to be put into the LaTeX file. Since python.sty requires that LaTeX be compiled with shell escapes, this may be a better way.
I can post the preprocessor if there is interest.

Resources