Advanced capstone 3.5

I am working on advanced capstone pt 3.5. I am required to do the following :

 

This function should:
* take one parameter x which is a string
* parse this string to return the first element of the parse tree

I tried this first but it fails as it returns the full parse tree and not the one element as required:

.perm.parseQuery:{ if[-10h=type x;x:enlist x]; $[10h=type x;parse x; x]}
.perm.parseQuery[“.fia.getSummaryReport[`today]”]

.fia.getSummaryReport ,today

This also fails for me however :

.perm.parseQuery:{[x] if[-10h=type x;x:enlist x]; $[10h=type x;t:parse x; x];t(0)} .perm.parseQuery[".fia.getSummaryReport[`today]"] ?Scratchpad

Which returns - `.fia.getSummaryReport   

Not sure what is causing the failed test any help would be appreciated 

This looks easier than you think it is: a parse tree is a list, and first returns its first element.

 

q).fia.getSummaryReport:{"Enjoy “,string x} q).fia.getSummaryReport today "Enjoy today" q)parse ".fia.getSummaryReport today” .fia.getSummaryReport ,today q)first parse “.fia.getSummaryReport today" .fia.getSummaryReport q).perm.parseQuery:first parse@ q).perm.parseQuery[”.fia.getSummaryReport[today]"] .fia.getSummaryReport

 

Thanks for the explanation on parse trees it was simpler than I was making it, however this solution still does not pass the test in the capstone 

quizItem success description error

exercise3.2 Pass “check password col is updated” “”
exercise3.3 Pass “.perm.users should exist on HDB process” “”
exercise3.4 Pass “define .z.pw on HDB process” “”
exercise3.4 Pass “give access to users with correct password” “”
exercise3.4 Pass “give access to users with wrong password” “”
exercise3.5 Fail “return first element of parse tree” “.perm.parseQuery”
exercise3.5 Fail “return ! if given update query” “.perm.parseQuery”

Could I see whatthe test is checking for exactly?

Nevermind I was forgetting to define it on the remote process where the tests where being run…