## Assignment 3, Task 2 (MultiArgFLAEPreproc), Test testZeroArg2

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

### Assignment 3, Task 2 (MultiArgFLAEPreproc), Test testZeroArg2

Hi,
in testZeroArg2 I don't understand how I can return '_. I tried a bit, but since underscores aare usually interpreted as being a placeholder I could find no way to return it, without getting an error message like
error: missing parameter type for expanded function
Anybody know how to do it? I would post more details, but I don't know whether that would reveal too much about my solution.

Talaron
Mausschubser
Beiträge: 85
Registriert: 26. Apr 2012 11:34

### Re: Assignment 3, Task 2 (MultiArgFLAEPreproc), Test testZeroArg2

Did you definitely use '_ (starts with a single quotation mark and no space in between, to make it a symbol) instead of _ ? Please also make sure you don't confuse it with ´ or  (the accent symbols). Scala can definitely handle the '_ symbol as any other symbol!

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

### Re: Assignment 3, Task 2 (MultiArgFLAEPreproc), Test testZeroArg2

• - I copied it from the test
- I used the symbol which on german keyboards is above #
- I used the accent , which is interpreted as quote and gives a error because no closing one is found
- I tried just simple _ or _:Symbol

Can I post the line where I am trying or is that too much of the solution (It is the line where I match params and it is empty)...

EDIT: It works now, there was another error in the code, sorry.

Talaron
Mausschubser
Beiträge: 85
Registriert: 26. Apr 2012 11:34

### Re: Assignment 3, Task 2 (MultiArgFLAEPreproc), Test testZeroArg2

Don't worry, this has happened to the best of us. I hope you still learned something and I'm looking forward to giving you full score for your solution.

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

### Re: Assignment 3, Task 2 (MultiArgFLAEPreproc), Test testZeroArg2

Ok, thanks. But before you can do that. I am trying sth similar with the case App, but I can't figure out how to return a FLAE-placeholder. If I try to give sth like

Code: Alles auswählen

App([some expression], _:FLAE)
I get
error: type mismatch;
found : MultiArgFLAEPreproc.FLAE => MultiArgFLAEPreproc.App
required: MultiArgFLAEPreproc.FLAE
So the next question is how I can return this placeholder. If I leave out the type, he just says
missing parameter type for expanded function

Talaron
Mausschubser
Beiträge: 85
Registriert: 26. Apr 2012 11:34

### Re: Assignment 3, Task 2 (MultiArgFLAEPreproc), Test testZeroArg2

Well, using an explicit Scala placeholder probably won't work well here, either because Scala misunderstands it as a function definition (in your case, Scala thinks you want to write a syntactic short form of "(x) => { App([...], x) }"), or because the compiler would probably end up inserting "null" for the placeholder, which breaks our interpreter.

But as you don't use the argument you pick anyway, you can insert basically anything you want. So how about just going for something like "Num(0)" or "Num(-1)" or whatever you find appropriate as an "ignore me" value.

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

### Re: Assignment 3, Task 2 (MultiArgFLAEPreproc), Test testZeroArg2

Ok, thanks. That worked, though I am not yet exactly sure how, but I'll figure it out