Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling procedures with delayed substitutions #26

Open
tueda opened this issue Nov 12, 2014 · 0 comments
Open

Calling procedures with delayed substitutions #26

tueda opened this issue Nov 12, 2014 · 0 comments

Comments

@tueda
Copy link
Collaborator

tueda commented Nov 12, 2014

I was just trying some tricky things and found the following code makes FORM freeze:

#define CALL(a) "
#call Test(`~a')
"

#procedure Test(a)
  #message a=`a'
#endprocedure

`CALL(1)'

.end

It seems to be an interference of the variables with the same name "a" between calling the procedure and the delayed substitution.

A workaround can be (1) to use different names:

#define CALL(a1) "
#call Test(`~a1')
"

#procedure Test(a)
  #message a=`a'
#endprocedure

`CALL(1)'

.end

or (2) not to give the arguments for the procedure (although it is a bit mysterious why it works):

#define CALL(a) "
#call Test
"

#procedure Test
  #message a=`a'
#endprocedure

`CALL(1)'

.end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant