Assignment 09

0b101101101
Endlosschleifenbastler
Endlosschleifenbastler
Beiträge: 179
Registriert: 15. Apr 2015 18:24

Assignment 09

Beitrag von 0b101101101 » 17. Jan 2017 15:12

"This implies that every call has to be a tail-call."
However, how am i supposed to do that, if isEmpty does not accept a continuation?
I guess, I have to assume that only the self-defined methods have to be called in CPStyle.

MrGumby
Mausschubser
Mausschubser
Beiträge: 65
Registriert: 16. Apr 2013 15:07

Re: Assignment 09

Beitrag von MrGumby » 17. Jan 2017 16:44

That is how I solved it (tasks 1 and 2 complete). Anything other (as you already said) does not make sense.

Ragnar
Mausschubser
Mausschubser
Beiträge: 63
Registriert: 21. Okt 2009 19:15

Re: Assignment 09

Beitrag von Ragnar » 17. Jan 2017 18:24

Yes, you can not do CPS with built in functions. (Also the predefined code in the interpreters does not always use CPS …)
But please make sure you use CPS with all of the self defined functions :-)

Antworten

Zurück zu „Archiv“