mathlink-1.1.0.0: examples/mltest.nb
(* Content-type: application/mathematica *)
(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)
(* CreatedBy='Mathematica 7.0' *)
(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[ 145, 7]
NotebookDataLength[ 4548, 134]
NotebookOptionsPosition[ 3912, 110]
NotebookOutlinePosition[ 4270, 126]
CellTagsIndexPosition[ 4227, 123]
WindowFrame->Normal*)
(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[
RowBox[{"SetDirectory", "[", "\"\<~/hs/mathlink/examples/\>\"",
"]"}]], "Input",
CellChangeTimes->{{3.439309979806336*^9, 3.439310029119624*^9}, {
3.439504790090583*^9, 3.439504790564527*^9}}],
Cell[TextData[{
"Wrapping the ",
StyleBox["MathLink",
FontSlant->"Italic"],
" executable in a shell script is a nice way to pass extra arguments to the \
GHC RTS without interfering with the command line arguments that ",
StyleBox["MathLink",
FontSlant->"Italic"],
" needs to pass to establish the connection."
}], "Text",
CellChangeTimes->{{3.440168766081661*^9, 3.440168924034021*^9},
3.442004040708877*^9}],
Cell[BoxData[
RowBox[{"lnk", "=",
RowBox[{"Install", "[", "\"\<mltest.sh\>\"", "]"}]}]], "Input",
CellChangeTimes->{{3.439310037308844*^9, 3.4393100665348454`*^9}, {
3.4393123483575773`*^9, 3.439312353820722*^9}, {3.439313763736014*^9,
3.439313786830782*^9}, {3.439314248568095*^9, 3.439314249330996*^9}}],
Cell[BoxData[
RowBox[{"AddTwo", "[",
RowBox[{"2", ",", "3"}], "]"}]], "Input",
CellChangeTimes->{{3.43931006947751*^9, 3.43931007209233*^9}}],
Cell[BoxData[
RowBox[{"ReverseNumbers", "[",
RowBox[{
"1", ",", "2", ",", "3", ",", "\[ImaginaryI]", ",", "\[ExponentialE]", ",",
"\[Pi]"}], "]"}]], "Input",
CellChangeTimes->{{3.4401687018512993`*^9, 3.440168712601337*^9}, {
3.440180321606152*^9, 3.440180358834758*^9}}],
Cell[BoxData[
RowBox[{"ReverseArray", "[",
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"1", ",", "2", ",", "3"}], "}"}], ",",
RowBox[{"{",
RowBox[{"4", ",", "5", ",", "6"}], "}"}]}], "}"}], "]"}]], "Input",
CellChangeTimes->{{3.440168935664534*^9, 3.440168948360408*^9}}],
Cell[BoxData[
RowBox[{"TweakExpression", "[",
RowBox[{"{",
RowBox[{"ASymbol", ",", "\"\<A string\>\"", ",", "3", ",",
RowBox[{"N", "[", "\[Pi]", "]"}], ",",
RowBox[{"a", "+", "b", "+", "c"}]}], "}"}], "]"}]], "Input",
CellChangeTimes->{{3.440177547780761*^9, 3.440177550781266*^9}, {
3.44017765139118*^9, 3.440177724259131*^9}, {3.440177844791916*^9,
3.440177845556456*^9}, {3.440178025829589*^9, 3.440178050101166*^9}}],
Cell[BoxData[
RowBox[{"AddExtendedComplexes", "[",
RowBox[{
RowBox[{"1", "+",
RowBox[{"3", "\[ImaginaryI]"}]}], ",",
RowBox[{"2", "+",
RowBox[{"5", "\[ImaginaryI]"}]}]}], "]"}]], "Input",
CellChangeTimes->{{3.440261725819941*^9, 3.44026175272886*^9}, {
3.440261869617639*^9, 3.440261870522575*^9}, {3.4402623078593616`*^9,
3.44026232761686*^9}, {3.440264128954616*^9, 3.440264134710162*^9}}],
Cell[BoxData[
RowBox[{"AddExtendedComplexes", "[",
RowBox[{"Infinity", ",",
RowBox[{"1", "+",
RowBox[{"3", "\[ImaginaryI]"}]}]}], "]"}]], "Input",
CellChangeTimes->{{3.4402623440640917`*^9, 3.4402623453541613`*^9}, {
3.440262468823717*^9, 3.440262473845871*^9}, {3.440264138208585*^9,
3.440264140343564*^9}}],
Cell[BoxData[
RowBox[{"AbortTest", "[", "50", "]"}]], "Input",
CellChangeTimes->{{3.4413814839615593`*^9, 3.44138148687442*^9}, {
3.4413858220378847`*^9, 3.441385824935438*^9}, {3.4413860876215363`*^9,
3.441386092152405*^9}, {3.441387279931728*^9, 3.4413872801019363`*^9}, {
3.4414187331544437`*^9, 3.4414187357368517`*^9}}],
Cell[BoxData[
RowBox[{"Uninstall", "[", "lnk", "]"}]], "Input",
CellChangeTimes->{{3.439313773653487*^9, 3.439313777607768*^9}}]
},
WindowSize->{1916, 1165},
WindowMargins->{{0, Automatic}, {4, Automatic}},
ShowSelection->True,
FrontEndVersion->"7.0 for Linux x86 (64-bit) (November 11, 2008)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)
(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[545, 20, 213, 4, 61, "Input"],
Cell[761, 26, 423, 11, 96, "Text"],
Cell[1187, 39, 315, 5, 61, "Input"],
Cell[1505, 46, 146, 3, 61, "Input"],
Cell[1654, 51, 284, 6, 61, "Input"],
Cell[1941, 59, 300, 8, 61, "Input"],
Cell[2244, 69, 444, 8, 61, "Input"],
Cell[2691, 79, 418, 9, 61, "Input"],
Cell[3112, 90, 327, 7, 61, "Input"],
Cell[3442, 99, 333, 5, 88, "Input"],
Cell[3778, 106, 130, 2, 88, "Input"]
}
]
*)
(* End of internal cache information *)