Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| teaching:cc4101:tareas:2026-1:tarea2:bonus [2026/05/11 16:15] – [Modificación de la gramática y parser] msegur | teaching:cc4101:tareas:2026-1:tarea2:bonus [2026/05/11 17:52] (current) – [Parte BONUS. Modificadores de with (1.0 pto)] Reformulación enunciado bduarte | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| [[teaching: | [[teaching: | ||
| - | ===== Parte BONUS. | + | ===== Parte BONUS. |
| - | En esta parte agregarán | + | En el lenguaje SL, el único lugar donde se puede especificar una estrategia |
| - | <code scheme> | + | Por ejemplo: |
| - | {with {by-name {fun {f : {Num -> Num}} -> {name {Num -> Num}} : | + | |
| - | f}} | + | |
| - | {with {foo {fun {x : Num} -> Num : | + | |
| - | x}} | + | |
| - | | + | |
| - | </ | + | |
| - | + | ||
| - | Modificaremos el ' | + | |
| <code scheme> | <code scheme> | ||
| - | '{with {foo name {fun {x : Num} -> Num : | + | {with {x : {name Num} {printn 10}} |
| - | x}} | + | {+ x x}} |
| - | foo} | + | |
| </ | </ | ||
| - | Esto también nos permite crear expresiones simples del lenguaje | + | enlaza '' |
| - | <code scheme> | + | <note tip>Noten en particular que la sintaxis requiere indicar el tipo completo, esto va a simplificar las cosas</note> |
| - | > | + | |
| - | {+ x x}}) | + | |
| - | (result 2 ' | + | |
| - | </code> | + | |
| ==== Modificación de la gramática y parser ===== | ==== Modificación de la gramática y parser ===== | ||

