It is currently Tue May 30, 2017 4:01 am



Welcome
Welcome to rfobasic

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today. **You are not required to provide truthful information to any registration questions. Be whomever you wish to be.!


Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Creating a List Before Including GW
Unread postPosted: Sat Dec 03, 2016 2:17 pm 
Offline
User avatar

Joined: Wed Jul 10, 2013 8:11 am
Posts: 328
Hi Nicolas,

Creating a list before including GW.bas the users get in trouble!
In the hope nobody create a list before, you use listpointers with constants.
I do not critisize that, because you have sure your reasons, but
that should be described in API reference and Cheat Sheet.
Or have I overread it.

/Gregor


Top
 Profile  
 
 Post subject: Re: Creating a List Before Including GW
Unread postPosted: Sat Dec 03, 2016 5:01 pm 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5518
Location: Paris, France
Ooh yes it will put you in big trouble indeed! :D

I never mentioned it but indeed GW.bas relies heavily on the "global" trick for it's bundles and lists.

You are absolutely right, I need to add a warning somewhere, or else use a better trick!

I'm thinking I could put all these list contents in the first "global" bundle, but I'll have to measure the impacts in terms of performance.

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: Creating a List Before Including GW
Unread postPosted: Sat Dec 03, 2016 5:34 pm 
Offline

Joined: Wed Feb 20, 2013 3:25 pm
Posts: 423
Location: Italy
I vote for just a warning.
I would not add another layer of indirection.

/ Luca


Top
 Profile  
 
 Post subject: Re: Creating a List Before Including GW
Unread postPosted: Sat Dec 03, 2016 5:42 pm 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5518
Location: Paris, France
This is the internal machinery of GW, it wouldn't be a layer of indirection but a contrario a simplification.

I'm not very fond of adding a warning, where put it? how technical should it be? I don't see how to keep it simple, I can't just say "don't create any list before calling include GW.bas" without explaining why, can I ?

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: Creating a List Before Including GW
Unread postPosted: Sat Dec 03, 2016 6:16 pm 
Offline

Joined: Wed Feb 20, 2013 3:25 pm
Posts: 423
Location: Italy
By another layer of indirection I mean access to the lists would become more indirect and this would degrade performance. But I agree that things would become cleaner, so if the price is not too high maybe it will be worth doing.
Anyway, to further reduce the risk of clashes in case there are bundle creations before INCLUDE "GW.bas", or in case other keys are used by someone else in the global bundle, I would suggest:
1. Change all the initial BUNDLE.PUT global, ...
into: BUNDLE.PUT 1, ...

2. Add the prefix "gw_" in front of all the keys of the global bundle.

Luca


Top
 Profile  
 
 Post subject: Re: Creating a List Before Including GW
Unread postPosted: Sat Dec 03, 2016 11:43 pm 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5518
Location: Paris, France
There wouldn't be access to lists anymore, and clearly not via bundle. The content of the lists would be moved to the bundle, already used by GW.

I came to the same conclusions as you for the global bundle, they already are part of my modifications.

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: Creating a List Before Including GW
Unread postPosted: Sun Dec 04, 2016 7:36 am 
Offline
User avatar

Joined: Wed Jul 10, 2013 8:11 am
Posts: 328
luca_italy wrote:
1. Change all the initial BUNDLE.PUT global, ...
into: BUNDLE.PUT 1, ...

In the hope nobody create a bundle before. :o

Gregor


Top
 Profile  
 
 Post subject: Re: Creating a List Before Including GW
Unread postPosted: Sun Dec 04, 2016 7:40 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5518
Location: Paris, France
aFox wrote:
luca_italy wrote:
1. Change all the initial BUNDLE.PUT global, ...
into: BUNDLE.PUT 1, ...

In the hope nobody create a bundle before. :o

Gregor

It won't matter.

...No, really, it won't, I let you think about it ;)

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: Creating a List Before Including GW
Unread postPosted: Sun Dec 04, 2016 9:36 am 
Offline
User avatar

Joined: Wed Jul 10, 2013 8:11 am
Posts: 328
mougino wrote:
aFox wrote:
luca_italy wrote:
1. Change all the initial BUNDLE.PUT global, ...
into: BUNDLE.PUT 1, ...

In the hope nobody create a bundle before. :o

Gregor

It won't matter.

...No, really, it won't, I let you think about it ;)


You are rigth until
INCLUDE DefMyVars.bas
INCLUDE GW.bas
BUNDLE.CLEAR DefMyVars_firstBundle
!or
BUNDLE.REMOVE DefMyVars_firstBundle

Gregor


Top
 Profile  
 
 Post subject: Re: Creating a List Before Including GW
Unread postPosted: Sun Dec 04, 2016 10:05 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5518
Location: Paris, France
Image

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
suspicion-preferred