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

Problem running proceures without pro #1868

Open
jaymurthy opened this issue Jul 21, 2024 · 5 comments
Open

Problem running proceures without pro #1868

jaymurthy opened this issue Jul 21, 2024 · 5 comments

Comments

@jaymurthy
Copy link

jaymurthy commented Jul 21, 2024

This program works ok on Sonoma 14.5
pro temp
print,'test'
end

If I remove the pro temp, it doesn't print anything. It used to work in 1.0.6-1gf84626e7
$ cat temp.pro
print,'test'
end
$ gdl
GDL - GNU Data Language, Version v1.0.6-16-gc154de16

  • For basic information type HELP,/INFO
  • Default library routine search path used (GDL_PATH/IDL_PATH env. var. not set): /usr/local/bin/../share/gnudatalanguage/lib
  • Using WxWidgets as graphics library (windows and widgets).
  • Using local drivers in /usr/local/bin/../share/gnudatalanguage/drivers
  • Please report bugs, feature or help requests and patches at: https://github.com/gnudatalanguage/gdl

GDL> .run temp
GDL>

@ChunkyPanda03
Copy link
Contributor

@jaymurthy I do believe that what you are talking about is running a file as though it was the module main. IDL handles this by running the main module with the .go command not .run, .run will never work as there is no procedure temp. From my understanding IDL % Compiled module: $MAIN$. and then runs the staged commands with the .go command (once again this is not a file).
An issue I have found is that there is no .go implementation in the gdl version v1.0.6-18-ga5083893-dirty which is the version I am running.

GDL> .go
GO not implemented yet.

@ChunkyPanda03
Copy link
Contributor

@jaymurthy I would suggest changing the title to something like .go command has no implementation.

@jaymurthy
Copy link
Author

You may be right but I've always run files like that and it has worked in GDL in the past. (Sreenshot attached).

Screenshot by Dropbox Capture

@GillesDuvert
Copy link
Contributor

Interesting, indeed IDL does:

IDL> .run temp
% Compiled module: $MAIN$.
testing
IDL> .go
testing

So this would be a regression.
IDL documentation says that .run can run 'main' programs, such as temp.pro

In the absence of '.go' (remember, GDL was not initially written for interactive development, only playing 'old' IDL programs 😄 ) .run temp is more or less @toto where toto is temp.pro without the 'end'.

@jtappin
Copy link

jtappin commented Sep 6, 2024

Coming in a bit late on this one.

In the absence of '.go' (remember, GDL was not initially written for interactive development, only playing 'old' IDL programs 😄 ) .run temp is more or less @toto where toto is temp.pro without the 'end'.

@ should (and I think is) be a strict line-by-line processing (I stopped using the @ method for anything beyond 1 line as changing the code while it was running produced seriously weird effects). Therefore blocks can only be made to work by using continuation lines, e.g. if prt.pro is:

for i = 0, 4 do begin
   print, i
endfor

gives:

GDL> @prt
% Parser syntax error: unexpected end of file
% PRINT: Variable is undefined: I
% Execution halted at: $MAIN$          
% Parser syntax error: unexpected token: ENDFOR
GDL> 

but:

for i = 0, 4 do begin & $
   print, i & $
endfor

does what is expected.

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

4 participants