From 4b28493fc73c5c0354e5c306f75d29370ef79078 Mon Sep 17 00:00:00 2001 From: Miguel de Benito Date: Thu, 13 Sep 2012 07:38:32 +0000 Subject: [PATCH] Typo --- devel/scheme/edit/edit-model.en.tm | 46 +++++++++++++++--------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/devel/scheme/edit/edit-model.en.tm b/devel/scheme/edit/edit-model.en.tm index 63a4063..b64b8e6 100644 --- a/devel/scheme/edit/edit-model.en.tm +++ b/devel/scheme/edit/edit-model.en.tm @@ -1,4 +1,4 @@ - + @@ -61,9 +61,9 @@ the variable contains the subscript in formula (). Then the instruction - <\scm-fragment> + <\scm-code> (tree-set! t "2") - + will simultaneously change the subscript into a and update the variable . Another nicety is that the value of is @@ -73,7 +73,7 @@ its location. Of course, the location of may be lost when or one of its parents is modified. Nevertheless, the modification routines are designed in such a way that we try hard to remember locations. For - instance, when insert ``+>'' in front of the formula + instance, if ``+>'' is inserted in front of the formula () using the routine , then keeps its value its location, even though one of its ancestors was altered. @@ -117,7 +117,7 @@ expression(). In this example, only the second cursor path is valid. Usually, the validity of a cursor path may be quickly detected using DRD (Data Relation Definition) information, which - is determined from the style file. In execeptional cases, the validity may + is determined from the style file. In exceptional cases, the validity may only be available after typesetting the document. It should also be noticed that all active trees are a subtree of the global @@ -156,26 +156,26 @@ instance, if corresponds to the expression(), then - <\scm-fragment> + <\scm-code> (select x '(rsub :%1)) - + returns a list with the two subscripts and . In fact, may also be used in order to navigate through a tree. For instance, if corresponds to the subscript in(), then - <\scm-fragment> + <\scm-code> (select t '(:up :next)) - + returns the list with one element ``+a>''. The routine is implicitly called by many routines which operate on trees. For instance, with as above, - <\scm-fragment> + <\scm-code> (tree-ref t :up :next) - + directly returns the tree ``+a>''. @@ -201,13 +201,13 @@ . Together with the routine for modifying a tree, this yields a first simple implementation: - <\scm-fragment> + <\scm-code> (define (swap-numerator-denominator) \ \ (with-innermost t 'frac \ \ \ \ (tree-set! t `(frac ,(tree-ref t 1) ,(tree-ref t 0))))) - + It should be noticed that the macro ignores its body whenever no innermost fraction is found. @@ -217,7 +217,7 @@ The following refined implementation allows us to remain at the ``same position'' modulo the exchange numerator/denominator: - <\scm-fragment> + <\scm-code> (define (swap-numerator-denominator) \ \ (with-innermost t 'frac @@ -227,7 +227,7 @@ \ \ \ \ \ \ (tree-set! t `(frac ,(tree-ref t 1) ,(tree-ref t 0))) \ \ \ \ \ \ (tree-go-to t (cons (- 1 (car p)) (cdr p)))))) - + Here we used the routines and , which allow us to manipulate the cursor position relative to a given tree. @@ -235,19 +235,19 @@ As the icing on the cake, we may make our routine available through the mechanism of structured variants: - <\scm-fragment> + <\scm-code> (define (variant-circulate t forward?) \ \ (:require (tree-is? t 'frac)) \ \ (swap-numerator-denominator)) - + Notice that this implementation can be incorrect when operating on nested fractions. The implementation can be further improved by letting operate on a specifictree: - <\scm-fragment> + <\scm-code> (define (swap-numerator-denominator t) \ \ (:require (tree-is? t 'frac)) @@ -257,17 +257,17 @@ \ \ \ \ (tree-set! t `(frac ,(tree-ref t 1) ,(tree-ref t 0))) \ \ \ \ (tree-go-to t (cons (- 1 (car p)) (cdr p))))) - + The corresponding generic routine could be defined as - <\scm-fragment> + <\scm-code> (define (swap-numerator-denominator t) \ \ (and-with p (tree-outer t) \ \ \ \ (swap-numerator-denominator p))) - + This piece of code will perform an outward recursion until a specific handler is found. We may now replace the call @@ -281,7 +281,7 @@ the original state by toggling a second time. We may explicitly conserve the focus as follows: - <\scm-fragment> + <\scm-code> (define (swap-numerator-denominator t) \ \ (:require (tree-is? t 'frac)) @@ -293,7 +293,7 @@ \ \ \ \ (tree-go-to t (cons (- 1 (car p)) (cdr p))) \ \ \ \ (tree-focus t))) - + This routine will even work when we are inside a nested fraction and operating on the outer fraction.