Page 1 of 1

Question about HOC syntax and section connection

Posted: Thu Dec 05, 2024 5:26 am
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!

Re: Question about HOC syntax and section connection

Posted: Thu Dec 05, 2024 1:44 pm
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

Re: Question about HOC syntax and section connection

Posted: Thu Dec 05, 2024 5:31 pm
by JeongJuM
Dear hines,

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

Best, jeongju.