WeBWorK Main Forum

passing a subroutine reference to withPostFilter

Re: passing a subroutine reference to withPostFilter

by Michael Gage -
Number of replies: 0
This might help. http://webwork.maa.org/wiki/Basic_Perl_syntax  It's pretty hold so it may not be comprehensive, but PG hasn't changed that much.

PG is a DSL (domain specific language). PG is to perl kind of like LaTeX is to TeX.  LaTeX is written in TeX and mostly extends the language, although sometimes it changes the underlying language a bit. (LaTeX used to be much worse in this regard when it was first written.)  

PG behaves much the same way and in fact was loosely modeled on the LaTeX/TeX relationship. For the most part it uses the perl parser but it overlays this with some preprocessing and with a large number of "macros", subroutines that extend the power of perl in ways that are useful writing math questions.

You can look through the code in this file to get an overview of how a .pg file is processed.