Re: [Pharo-project] learning rewrite rules
On Nov 4, 2010, at 5:51 PM, Lukas Renggli wrote:
ok I added the files this is better.
Yes, I could read the french article now.
I am not quite convinced with the explanation of the back-tick though:
"Un schéma peut contenir des variables en utilisant le backquote ou accent grave. Ainsi, `key représente nâimporte quelle variable, mais pas une expression."
"`key" is a *meta-variable*, not necessarily a variable in the matched tree. Depending on the context it can also be a selector, e.g. "foo `key" matches all unary selectors sent to a variable called 'foo'.
I wrote that probably in 2000 so this is probably wrong. May be my english was confused too because I took that from john's slides. Indeed this is not correct, key is a meta variable that can contain an element
Ok, my french might not be that good :-)
Also check page 42--43 of my PhD (http://scg.unibe.ch/archive/phd/renggli-phd.pdf): 4.1.1 Tree Pattern Matching. It is a bit dense and doesn't explain everything, but the basic matching is described and was successfully tested on students.
yes we should use that. what would be excellent is that we could get a nice set of examples that people can pick to help them. So I started to collect the answers so send to the list and for example the questions of doru are a good source I know that I often forgot to handle the other statements in a match.
Lukas
-- Lukas Renggli www.lukas-renggli.ch
participants (1)
-
Stéphane Ducasse