Question about HOC syntax and section connection

Anything that doesn't fit elsewhere.
Post Reply
JeongJuM
Posts: 2
Joined: Wed Jul 19, 2023 3:19 am

Question about HOC syntax and section connection

Post by JeongJuM »

Hello,
I have some questions regarding HOC syntax.

I am working on a processor to simplify a cell's morphology.

The cell is instantiated from a template. In the processor, I delete all sections except for the soma and then create a new axon.

I tried to connect the axon to the soma using the following command:

hoc
oc> connect axon[0](0), cell.soma(1)

However, I encountered an error:
nrniv.exe: stack underflow

It seems this method does not work.

Then, I tried the following instead:

hoc
cell.soma {connect axon[0](0) , 1}

This approach worked.

Could you explain why the first method is not possible, while the second one works?

Thank you!
hines
Site Admin
Posts: 1707
Joined: Wed May 18, 2005 3:32 pm

Re: Question about HOC syntax and section connection

Post by hines »

nrniv.exe: stack underflow

The

Code: Select all

connect child, parent
syntax is unfortunately limited in that the parent cannot be of the form

Code: Select all

obj.sec
as the sequence of tokens syntactically conflicts with other syntax in the HOC language. That is, with that form of the connect statement, the parent must be a literal section name. If the parent involves object syntax then you must use the generic form

Code: Select all

parent connect child
JeongJuM
Posts: 2
Joined: Wed Jul 19, 2023 3:19 am

Re: Question about HOC syntax and section connection

Post by JeongJuM »

Dear hines,

Thank you for the clear and easy-to-understand explanation.

Best, jeongju.
Post Reply