comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » .compile_opt strictarr is persistent?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
.compile_opt strictarr is persistent? [message #50591] Mon, 09 October 2006 10:51
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
As David so cleverly discovered, I converted MPFIT to square bracket
array subscript notation a few weeks ago. To enforce the new "habit,"
I also placed the following directive inside the function,

.compile_opt strictarr

which is supposed to "change some of the default rules for compiling
the function or procedure within which the COMPILE_OPT statement
appears," according to the official documentation.

However, since I've made the conversion, I have noticed that any time
I use MPFIT, and *then* use round parentheses notation on the command
line, IDL complains about syntax errors.

According to the documentation, the compile option should be limited
to the function where the option appears. However, this compile
option seems to "bleeding" into the command line.

For example, see how round parentheses work fine,

IDL> a = dblarr(10)
IDL> print, a(4:*)
0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
0.0000000

Then in the same session, we compile MPFIT and round parens no longer work.
IDL> .comp mpfit
...
IDL> print, a(4:*)

print, a(4:*)
^
% Syntax error.


Any idea what's going on here. Is IDL really being that silly?

Should I put the .compile_opt statement *within* each individual
function in the module?

This problem applies to IDL 5.6-6.3.

Thanks,
Craig

[ I should say that about half the people I work with still use the
round parentheses notation. It's very confusing to them to have the
behavior of IDL change dramatically depending on whether they use
MPFIT or not. ]


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: eval
Next Topic: wrapper functions

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 03:15:25 PDT 2025

Total time taken to generate the page: 0.64155 seconds