[PB 5.2b4] Please Rename Module to Package

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

[PB 5.2b4] Please Rename Module to Package

Post by fsw »

EDIT: This request was almost completed with PB 5.2b5
Library "Module" was renamed to "Music".
The only thing that remains is the renaming of UnusePackage, as "unuse" is not a commonly used word (there is "unused" but this doesn't fit either).
Suggestions:
Bind / Unbind suggested by Demivec;
Attach / Detach suggested by Luis;
Use / Release suggested by fsw.

Thinking of it: Attach / Detach would be the best choice.
- end of edit -
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The commands would look like this:

Code: Select all

DeclarePackage
EndDeclarePackage
Package
EndPackage
UsePackage
UnusePackage
See here:
http://www.purebasic.fr/english/viewtop ... 3&start=25

The reason:
Modules already exist as music modules...

Code: Select all

CatchModule
FreeModule
GetModulePosition
GetModuleRow
IsModule
LoadModule
ModuleVolume
PlayModule
SetModulePosition
StopModule
Thanks

BTW: ClosePackage is the logical complementary command to UsePackage instead of UnusePackage.
It follows the following conventions:

Code: Select all

UseGadgetList() / CloseGadgetList()
Use...Database() / OpenDatabase() / CloseDatabase()
Use...Packer() / OpenPack() / ClosePack()
Last edited by fsw on Mon Jul 01, 2013 6:14 am, edited 6 times in total.

I am to provide the public with beneficial shocks.
Alfred Hitshock
Little John
Addict
Addict
Posts: 4777
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: [PB 5.2] Please Rename Module to Package

Post by Little John »

fsw wrote:The reason:
Modules already exist as music modules...

Code: Select all

CatchModule
FreeModule
GetModulePosition
GetModuleRow
IsModule
LoadModule
ModuleVolume
PlayModule
SetModulePosition
StopModule
UUUhhh... :cry:

Oh yes, the new "Modules" should be renamed then.
+1
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: [PB 5.2] Please Rename Module to Package

Post by PB »

+1
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Re: [PB 5.2] Please Rename Module to Package

Post by eddy »

:shock: I forgot these functions
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
Fred
Administrator
Administrator
Posts: 18153
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [PB 5.2] Please Rename Module to Package

Post by Fred »

fsw wrote:BTW: ClosePackage is the logical complementary command to UsePackage instead of UnusePackage.
It follows the following conventions:

Code: Select all

UseGadgetList() / CloseGadgetList()
Use...Database() / OpenDatabase() / CloseDatabase()
Use...Packer() / OpenPack() / ClosePack()
No, UseGadgetList() has no complement (CloseGadgetList() works only after OpenGadgetList())
Use...Database() and Use...Packer() has nothing to do with the respective close commands.

Open -> Close
Load/Create -> Free
Use -> nothing for now, so it's Unuse (may be not the best english word, but at least it describes well the behaviour).

I will think about the renaming. May be it would easier to rename the Module lib to Music lib as it's a better description anyway.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: [PB 5.2] Please Rename Module to Package

Post by ts-soft »

+1 for renaming the "Music"-Module lib.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Demivec
Addict
Addict
Posts: 4260
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: [PB 5.2] Please Rename Module to Package

Post by Demivec »

+1 for renaming the "Music" Module lib.


Suggestions on alternative names for UseModule/UnuseModule in the other Module lib:
  • IncludeModule/ExcludeModule
    ActivateModule/DeactivateModule
    OpenModule/CloseModule
    EnterModule/LeaveModule
    BindModule/UnbindModule
Each have Pro's and Con's regarding their use but I lean towards either Activate/DeactivateModule or BindModule/UnbindModule (costs only an extra letter each :) ).


I am also interested in an 'ImportModule ... As ...' or a 'RenameModule modulename, newname' for dealing with name clashes.
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: [PB 5.2] Please Rename Module to Package

Post by c4s »

Demivec wrote:I am also interested in an 'ImportModule ... As ...' or a 'RenameModule modulename, newname' for dealing with name clashes.
You should put this in a separate feature request as it's a great suggestion!
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: [PB 5.2] Please Rename Module to Package

Post by PB »

> Use -> nothing for now, so it's Unuse (may be not the best english word [...]

Maybe Use/Discard ?
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Little John
Addict
Addict
Posts: 4777
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: [PB 5.2] Please Rename Module to Package

Post by Little John »

Demivec wrote:I am also interested in an 'ImportModule ... As ...' or a 'RenameModule modulename, newname' for dealing with name clashes.
This would be useful, but I think no new keyword is needed. This functionality can be offered as extended syntax of "UseModule":

Code: Select all

UseModule X
UseModule X As Y
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: [PB 5.2] Please Rename Module to Package

Post by ts-soft »

Little John wrote:This would be useful, but I think no new keyword is needed. This functionality can be offered as extended syntax of "UseModule":

Code: Select all

UseModule X
UseModule X As Y
But you can't use this Syntax for fullqualified using of Module.
example:

Code: Select all

ImportModule Common As Default
Default::Foo()
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Little John
Addict
Addict
Posts: 4777
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: [PB 5.2] Please Rename Module to Package

Post by Little John »

ts-soft wrote:But you can't use this Syntax for fullqualified using of Module.
Ah, I understand. Thanks for the explanation.
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Re: [PB 5.2] Please Rename Module to Package

Post by fsw »

Fred wrote:...I will think about the renaming. May be it would easier to rename the Module lib to Music lib as it's a better description anyway.
Sure, renaming the music library would work too. My initial thought was that tons of users would not be amused about changing it, but maybe nobody uses it anyway... :shock:

BTW: What about ReleaseModule?

I am to provide the public with beneficial shocks.
Alfred Hitshock
User avatar
luis
Addict
Addict
Posts: 3893
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: [PB 5.2] Please Rename Module to Package

Post by luis »

We have StartDrawing. When executed the following graphic operations works on a specified target/context.
StopDrawing release the association.

There is some analogy with modules.
So maybe StartUsingModule and StopUsingModule would be fair equivalents.

The little problem I see is StopUsingModule does not really block you to use it if you specify a fully qualified name, so it's slightly improper.

A better candidate could be AttachModule / DetachModule.

This does not have the implications of "closing", "freeing", and "releasing", all denoting an impossibility of further access not really existing thanks to the "::" qualifier.

When you attach a module, you can call its procedures without qualifiers, when you detach the module you can't do that anymore but you can still invoke its procedures using the full name qualifier since the module does not cease to exist (not freed, closed, released).

Sounds reasonable to me, and almost anything it's better than "Unuse" :D

EDIT: Just saw the Bind / Unbind suggested by Demivec above. This too sounds nice, even if I still slightly prefer Attach / Detach. Binding brings to mind a slightly different concept to me.
"Have you tried turning it off and on again ?"
A little PureBasic review
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: [PB 5.2] Please Rename Module to Unit

Post by Tenaja »

+1 to addressing this issue; I, too, saw the issue immediately when searching Help to see if it was documented.

If you like "Module", I would be ok with changing the music module; like you said it was not as consistent with current naming. Anyone with old code can either use an old compiler or do a search/replace.

Another option for renaming the new Module (in lieu of Package) is Unit, which is used in Pascal. Or maybe you would rather avoid that if the two systems have significant conflicts in their implementations.
Post Reply