Mercurial > js4py-pl
changeset 95:95ef8898e43e europython-2011
Add two sample JavaScript files and teaser.tex.
| author | Jonathan Fine <jfine@pytex.org> |
|---|---|
| date | Sat, 02 Jul 2011 22:15:21 +0100 |
| parents | 454054afcc0a |
| children | f6e1dca9ff21 |
| files | js/create.js js/get-set.js teaser.tex |
| diffstat | 3 files changed, 76 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/create.js Sat Jul 02 22:15:21 2011 +0100 @@ -0,0 +1,7 @@ + var _create_fn = function(){}; + var create = function(parent){ + + _create_fn.prototype = parent; + var instance = new _create_fn(); + return instance; + }; \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/get-set.js Sat Jul 02 22:15:21 2011 +0100 @@ -0,0 +1,15 @@ +var make_get_set = function(){ + + var v = null; + + var fset = function(value){ + v = value; + }; + + var fget = function(){ + + return v; + }; + + return [fset, fget]; +}; \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/teaser.tex Sat Jul 02 22:15:21 2011 +0100 @@ -0,0 +1,54 @@ +\begin{frame} + +\frametitle{JavaScript for Python Programmers} + +The course slides are available on http://bitbucket.org/jfine. + + +\bigskip +Go to +javascript-for-python-programmers/downloads. + +\bigskip +Download latest version of js4py. + +\end{frame} + +\begin{frame} + +\frametitle{JavaScript for Python Programmers} + +A major part of the tutorial is to understand properly the +\emph{counters example} in the tutorial. + +\begin{itemize} +\item gotchas + +\item object tree + +\item this vs. self + +\item binding + +\item delegation + +\item objects and classes in Python and JavaScript + +\end{itemize} + + +\end{frame} + +\begin{frame} + +\frametitle{To finish, if there is time} + + +We will show why \emph{JavaScript objects} are like Python classes +which are never instantiated, and which have special attribute and +item access methods on the metaclass. + +\end{frame} + +\end{document} +
