Empty table with foreign key

I am trying to run this code from here http://www.kx.com/q/d/kdb+1.htm :

s:([s:()]name:();status:();city:())

p:([p:()]name:();color:();weight:();city:())

sp:(s:s$();p:p$();qty:())

But I am getting an error saying 'type

What am I doing wrong? 

Sometimes I get the error other times I don’t…

Please see attached screen capture.

I just got the latest q (today’s version it seems) and the issue doesn’t happen anymore…

It’s a globals issue, you have defined s and p in the .dw namespace (notice your prompt “.q.dw)” )

Use “\d .” to return yourself to the default namespace.

 \d . will return you to the default namespace. 

I see, thanks! To still stay under .dw looks like this instead works:

s:([s:()]name:();status:();city:())

p:([p:()]name:();color:();weight:();city:())

sp:(s:.dw.s$();p:.dw.p$();qty:())