Questions slides/code 1-5 + 'Intro to Scala'
Verfasst: 20. Feb 2017 11:57
Hi there,
I collected the questions I have for the first few slide sets. Here goes:
1) 'Intro to Scala': trait is described as similar to interfaces in Java, but with state and fields. So it is actually nearer to an abstract class, right?
2) Slide 2, p.27: Typo in case Num(n) => expo instead of expr (as in the code)
3) Code V03: Why is the env in the F1LAEDynamicInterp called SubRep (and not env like in F1LAEStaticInterp), when it is acts exactly like it?
4) Code V05: What is the difference between in RCFLAEFunFuns and in RCFLAEInterpMeta. One is a function, the other a map, but what difference does it make in the evaluation?
5) Could you upload the solution for the non-programming tasks of exercise 10? Especially: is call-by-name the same as call-by-reference and if not what is the difference? And can you tell me whether I understood the three correctly:
- call-by-value is eager evaluation (value is evaluated and then passed)
- call-by-reference is lazy evaluation (as in lecture 10, where we passed the EClosure, instead of the value)
- call-by-need is sth. like super-lazy evaluation, where we'd use the EClosure just once and then stored that result similarly to call-by-value
??
Thank you
!
I collected the questions I have for the first few slide sets. Here goes:
1) 'Intro to Scala': trait is described as similar to interfaces in Java, but with state and fields. So it is actually nearer to an abstract class, right?
2) Slide 2, p.27: Typo in case Num(n) => expo instead of expr (as in the code)
3) Code V03: Why is the env in the F1LAEDynamicInterp called SubRep (and not env like in F1LAEStaticInterp), when it is acts exactly like it?
4) Code V05: What is the difference between
Code: Alles auswählen
type Env = (Symbol) => Value
Code: Alles auswählen
type Env = scala.collection.Map[Symbol, Value]
5) Could you upload the solution for the non-programming tasks of exercise 10? Especially: is call-by-name the same as call-by-reference and if not what is the difference? And can you tell me whether I understood the three correctly:
- call-by-value is eager evaluation (value is evaluated and then passed)
- call-by-reference is lazy evaluation (as in lecture 10, where we passed the EClosure, instead of the value)
- call-by-need is sth. like super-lazy evaluation, where we'd use the EClosure just once and then stored that result similarly to call-by-value
??
Thank you
