Skip to content
Matlab with s-expressions.
Emacs Lisp Matlab Objective-C
Latest commit b14f71f May 26, 2012 @VincentToups NORMAL added caching of symbol mangling, limited unmangling support, …
…partial parenlab printer.
Failed to load latest commit information.
.gitignore NORMAL more features. Apr 15, 2012
ampersand.m
andFunction.m
caret.m NORMAL added ^ and .^ support, for and forcell with indexing options. Apr 20, 2012
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 NORMAL significant evolution for more complete features when inside f… May 11, 2012
dotcaret.m
dotdivide.m
echoReturn.m NORMAL significant evolution for more complete features when inside f… May 11, 2012
equal.m
equalOneOf.m
equal_.m
equalcloseParen.m
equalcloseSquare.m
equaldigit.m
equalequal.m NORMAL incremental improvements. Apr 16, 2012
equalgreaterThanitems.m
equalgreaterThanmaybe.m
equalgreaterThannumber.m
equalgreaterThanor.m
equalgreaterThanstring.m
equalgreaterThanzeroOrMore.m
equalitem.m
equalkeyword.m Added monadic parser combinator library and function expression resol… May 17, 2012
equallispString.m Added monadic parser combinator library and function expression resol… May 17, 2012
equallistOfSexpressions.m NORMAL added support for cached REQUIRE operations and a monadic pars… May 22, 2012
equalnil.m
equalnumber.m Added monadic parser combinator library and function expression resol… May 17, 2012
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 Added monadic parser combinator library and function expression resol… May 17, 2012
makeSymbol.m
minusgreaterThan.m NORMAL significant evolution for more complete features when inside f… May 11, 2012
minusminus.m
monadic-parser-combinators.m
monadic-parser-combinators.parenlab
monadicParserCombinators.m Added monadic parser combinator library and function expression resol… May 17, 2012
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 Added monadic parser combinator library and function expression resol… May 17, 2012
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 NORMAL more features. Apr 15, 2012
tildaequal.m
todo.org
treeFiles.m NORMAL added caching of symbol mangling, limited unmangling support, … May 26, 2012
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.