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

Literal function name call fails #61

Open
BobBolch opened this issue Jan 2, 2021 · 7 comments
Open

Literal function name call fails #61

BobBolch opened this issue Jan 2, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@BobBolch
Copy link
Collaborator

BobBolch commented Jan 2, 2021

When the function name in a function call is a literal, the call fails.

ftest
2 - say 'SUBSTR'('NOK',2,2)
Error 43 running ftest, line 2: Routine not found
Ready(20043); T=0.01/0.02 10:05:04

t ftest exec

/* */
say 'SUBSTR'('NOK',2,2)

Ready; T=0.01/0.01 10:05:12


On real REXX:
ftest
OK
Ready; T=0.01/0.01 10:05:41

@adesutherland adesutherland added the bug Something isn't working label Jan 30, 2021
@mgrossmann
Copy link

mgrossmann commented Mar 19, 2021

strange behavior if I have added a working call in front of the non working.
then all went fine:

/* REXX */                 
PARSE VERSION LANG VER     
                           
SAY "### "LANG" "VER" ###" 
SAY " "                             

SAY SUBSTR('NOK',2,2)  
SAY 'SUBSTR'('NOK',2,2) 
Ready;                               
tst61                                
### CMS bREXX 0.9.12 Mar 15 2021 ### 
                                     
OK                                   
OK                                   

I would guess the compiler.
I'll have to take a closer look tonight.

@BobBolch
Copy link
Collaborator Author

BobBolch commented Mar 19, 2021 via email

@BobBolch
Copy link
Collaborator Author

BobBolch commented Mar 19, 2021 via email

@mgrossmann
Copy link

Sorry Bob,

you are right, I had a typo in my first test. :(
Have deleted my older comments.

/MIkeG

/* REXX */                
PARSE VERSION LANG VER    
                          
SAY "### "LANG" "VER" ###"
SAY " "                   
                          
SAY SUBSTR('NOK',2,2)     
SAY 'SUBSTR'('NOK',2,2)
Ready;                          
tst61                           
### REXX370 3.40 17 Jan 1984 ###
                                
OK                              
OK                              
Ready;     

@RossPatterson RossPatterson self-assigned this Nov 4, 2024
@RossPatterson
Copy link
Collaborator

I can reproduce this with Bob Bolch's 2021-01-02 test case (above) on original bREXX at the current source level (2.1.9+). I'll work on a fix and then port it here.

@RossPatterson
Copy link
Collaborator

This is not going to be as easy to fix as I had hoped. The code in compile.c:_AddLabel() that decides which type of routine to execute does not contemplate having two routine with the same name. In its mind, internal routines override built-in functions of the same name, which override external routines of the same name. I'm putting this issue back in the inactive list for now.

@RossPatterson
Copy link
Collaborator

Note: The CALL 'routine_name' instruction behaves exactly the same way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants