Type information

m.v.
Neuling
Neuling
Beiträge: 4
Registriert: 20. Apr 2012 06:03

Type information

Beitrag von m.v. »

I would appreciate it if we get more type information in the Test classes in WebLab.

I know that one of the advantages of scala is that you don’t have to write the type (of a variable or a method) if the type is clear from the context (and I love that feature). For the test classes however the type is often not clear from the context (since we often have to modify or to add certain case class of the interpreter).

Of Course so far it was always possible to figure out the type but in my opinion it is just a stupid task. Should you think it’s a necessary burden for us to figure out the type then please provide a more detailed task description.

Wambolo
Computerversteher
Computerversteher
Beiträge: 381
Registriert: 18. Okt 2007 11:36

Re: Type information

Beitrag von Wambolo »

I agree. I would appreciate some more hints.

Wambolo
Computerversteher
Computerversteher
Beiträge: 381
Registriert: 18. Okt 2007 11:36

Re: Type information

Beitrag von Wambolo »

The Boolean Interpreter task says that the interpreter of the first task should be able to handle the boolean expressions.

How could I define the type of ctor so that it accepts both ctor('aSymbol) and ctor('aSymbol, List(aListElement))...

m.v.
Neuling
Neuling
Beiträge: 4
Registriert: 20. Apr 2012 06:03

Re: Type information

Beitrag von m.v. »

you can use something like:
Ctor(a: Symbol, b: List[...] = List.empty )

Wambolo
Computerversteher
Computerversteher
Beiträge: 381
Registriert: 18. Okt 2007 11:36

Re: Type information

Beitrag von Wambolo »

thanks, works 'out of the box'

Antworten

Zurück zu „Archiv“