Skip to content
Matlab with s-expressions.
Emacs Lisp Matlab Objective-C
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore
ampersand.m
andFunction.m
caret.m
cellArray.m
cellEqual.m
cellminusgreaterThanrstring.m
condHelperFirstTrue.m
countOf.m added structural equality test 'equal' May 11, 2012
deletemtimes.m
directoryContents.m
directoryDirectories.m
directoryFiles.m
divide.m
divideand.m
dotcaret.m
dotdivide.m
echoReturn.m
equal.m
equalOneOf.m
equal_.m
equalcloseParen.m
equalcloseSquare.m
equaldigit.m
equalequal.m
equalgreaterThanitems.m
equalgreaterThanmaybe.m
equalgreaterThannumber.m
equalgreaterThanor.m
equalgreaterThanstring.m
equalgreaterThanzeroOrMore.m
equalitem.m
equalkeyword.m
equallispString.m Added monadic parser combinator library and function expression resol… May 17, 2012
equallistOfSexpressions.m
equalnil.m
equalnumber.m
equalnumberPhStyle.m
equalopenParen.m
equalopenSquare.m
equalquotedSexpression.m
equalsexpression.m
equalsexpressionplusspaces.m
equalsharpQuotedSexpression.m
equalspace.m
equalspaces.m
equalsymbol.m
equalvectorOfSexpressions.m
extendStruct.m
fif.m First commit. Apr 13, 2012
fileDirectory.m
fileName.m
flatAcross.m
flatDown.m
funcall.m
greaterThanequal.m
isclass.m
keywordp.m
lessThan.m
lessThanequal.m
makeKeyword.m
makeSymbol.m
minusgreaterThan.m
minusminus.m
monadic-parser-combinators.m
monadic-parser-combinators.parenlab
monadicParserCombinators.m
monadicParserCombinatorslessThan2greaterThan.m
more-info.md
mtimesmtimes.m NORMAL significant evolution for more complete features when inside f… May 11, 2012
negate.m
numericminusgreaterThanrstring.m
objectminusgreaterThanplString.m
orFunction.m
parenlab-aux.el
parenlab.el
pbind.m
pipepipe.m
plusplus.m NORMAL significant evolution for more complete features when inside f… May 11, 2012
preturn.m
progn.m NORMAL better progn form some awareness of expression vs statement co… Apr 23, 2012
readme.md
stringminusgreaterThanrstring.m NORMAL added caching of symbol mangling, limited unmangling support, … May 26, 2012
structAccess.m
structAccessdividec.m
structEqual.m
symbolp.m
test.m
testFunction.m
tests.el
tildaequal.m
todo.org
treeFiles.m
valCond.m

readme.md

Parenlab

(Note: parenlab depends on shadchen-el and requires Emacs).

Parenlab is a dirty cross compiler which forces an s-expression front end onto Matlab, a bit like parenscript for Javascript.

It is also a case study in using shadchen, my pattern matching library, to write nice code.

More to come.

More

Parenlab converts this:

(addpath "~/elisp/utils/parenlab/")
(setq file-name (lambda (file)
                          (with parts (tokenize file "/")
                                ({} parts end))))
        (setq is-cross-model-file 
              (lambda (f) (not (== (dsf f nil :train-perc -1) -1))))
        (setq files (ddirnames "ccModelsZeroForced" is-cross-model-file))
        (for i (: 1 (length files))
             (setq file ({} files i))
             (load file)
             (plotCrossModel model)
             (with file (strrep (file-name file)  ".txt" "")
                   (vprint ["crossModel" file])))

To:

addpath('~/elisp/utils/parenlab/');
fileName = @(file)funcall(@(parts)parts{end}, tokenize(file, '/'));
isCrossModelFile = @(f)~(equalequal(dsf(f, [], 'trainPerc', -1), -1));
files = ddirnames('ccModelsZeroForced', isCrossModelFile);
for i = ((1):(length(files)))
  file = files{i};
  load(file);
  plotCrossModel(model);
  funcall(@(file)vprint([ 'crossModel' file ]), strrep(fileName(file), '.txt', ''));
end
;

Parenlab uses Emacs Lisp to give matlab all the wonderful convenience of s-expressions AND meta-programming while still being Matlab. The user can define new macros that operate at the level of the s-expression representation of Matlab code. Underneath, the generated code has access to all the powerful analytic and plotting abilities of Matlab (or Octave, if you are running it.)

Something went wrong with that request. Please try again.