A Problem with v2.4 (for Rob)

new topic     » topic index » view thread      » older message » newer message

Hello again Rob,

While working with v2.4 i came upon a problem that has
quite profound consequences.  The problem centers around
the new implementation of 'include as'.


--in file SomeoneElsesExistingFuncs.ew--------
procedure DoSomething()
  ?{1}
end procedure
-- and 100 other procedures already named.
----------------------------------------------

--in file MyNewFuncs.ew-----------------------
procedure DoSomething()
  ?{2}
end procedure
-- and 99 other procedures, a lot with the same
-- names as in SomeoneElsesExistingFuncs.ew

----------------------------------------------

-- MyNewFuncs.ew DoSomething() does something slightly different
-- then that which is in SomeoneElsesExistingFuncs.ew


-- all the following in file Test.exw ...

include SomeoneElsesExistingFuncs.ew
include MyNewFuncs.ew as MF


-------Someone elses existing .exw code section---------
  DoSomething()
  -- and call 100 other functions already named in
  -- SomeoneElsesExistingFuncs.ew
---------------------------------------------------

-------My new code section (also in Text.exw)---------
MF:DoSomething() --<----flags a name qualifier required error.
-- and call 99 other functions already named in
-- both MyNewFuncs.ew
-------------------------------------------------------

The interpreter flags a name qualifier required error because
it doesnt see that "MF:DoSomething()" is different then simply 
"DoSomething()".  This is exactly the same as Euphoria 2.2.
This reduces the value of 'include as' in programming technique.
You should be able to block completely the new code so as to
provide perfect encapsulation without having to change
var names.

This means that either one of two things has to happen:
1. rename all the procedures in SomeoneElsesExistingFuncs.ew
2. rename all the procedures in MyNewFuncs.ew

Isnt this exactly the same as it was before v2.3 i think?

If someone wants to include a file both without a name qualifier
and with a name qualifier all they have to do is use the following
code:
include TheirFile.ew as TF
include TheirFile.ew

and that would acheive the same thing that exists now.
This means if the interpreter is changed to stop recognition
of globals in files that are exclusively included
with 'include as' then this default action can be turned on
or off by either using one line of code or two (as above).

This really has a big effect on what you can and cant write
when it might be used with other peoples include files.

Once this works it's going to be very useful.  The impact
on the code that can be allowed will be incredible.


Take care for now,
Al

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu