BAM "dev" and "prod" directives
#1
A program can be at one of two promotion levels: development or production.

When at the development level, there are two versions of the program available: development and production.

When at the production level, there is only the one version of the program: production.  Until edited, at which point it is back at the development level.

That aside:

We may want a program to look/behave differently depending on what version we are running/exporting.
This is where the "dev" and "prod" preprocessor directives come in.

Sample code:



Code: (Select All)
<<dev """
greet$ = "howdy buds, this is the development version of the program"
""">>

<<prod """
greet$ = "good day ladies and gentlement, this is the production version of the program"
""">>

print greet$

In the sample code above, greet$ will have one value when we are running the development version, and a different value when running the production version.
Reply
#2
I guess an ordinary QB64(PE) program having $IF THESE THEN preprocessor directives, will need to get them stripped in favor of <<prod """these""">> directives for this other processor. In "production" the programmer must be polite if he/she doesn't know who is the user of his/her program...
Reply
#3
(11-22-2022, 12:01 AM)mnrvovrfc Wrote: I guess an ordinary QB64(PE) program having $IF THESE THEN preprocessor directives, will need to get them stripped in favor of <<prod """these""">> directives for this other processor. In "production" the programmer must be polite if he/she doesn't know who is the user of his/her program...

Apologies, cognitive disability over here, which makes it hard for me to express my thoughts and understand what others are saying/writing.

Does QB64(PE) have IF THESE THEN preprocessor directives?  If so, I totally missed that in the wiki.

The rest of your reply, I don't understand what you are saying.

To clarify my part, the "dev" and "prod" directives allow deploying a BASIC program in either development or production versions, regardless of the current promotion state of a program.

To make easy for a user to know what version they are in, you might make the development versions' screen black text on yellow brackground, and the production version lightgreen text on black background.  Then the user has a very obvious cue of which version they are in.  So they know that when they are testing something, they are at the right program.  And when they want to do "production" stuff, that they are in the right program.

I'm not sure I'm explaining myself right.
Reply
#4
I don't know if images help conveying what I'm thinking.

You can export either development or production version of the programs as single-html-file programs for running in web browsers, or export either development or production version of the programs as .BAS files to open in QB64(pe) and compile into EXE's, to then have development and production versions of the executable files.

   

   
Reply
#5
(11-22-2022, 12:01 AM)mnrvovrfc Wrote: I guess an ordinary QB64(PE) program having $IF THESE THEN preprocessor directives, ...strip...

Ah, I was looking at https://qb64phoenix.com/qb64wiki/index.p...tacommands in the wiki.

Whatever metacommands do exist for QB64(pe), I consider them non-existent if they are not easy to be discovered where one would expect to discover them.

I'd offer to fix that because I love documentation, but I can't contribute to that wiki.  The technology and the process are too heavy for this kid.

These metacommands do not look like any fun to implement in BAM when I've already got the ridiculously easy and fun TiddlyWiki scripting language that kicks serious caboose for this kind of stuff.  I know nothing that can touch TW's transclusion and filtering capabilities.
Reply
#6
(11-22-2022, 02:58 AM)CharlieJV Wrote:
(11-22-2022, 12:01 AM)mnrvovrfc Wrote: I guess an ordinary QB64(PE) program having $IF THESE THEN preprocessor directives, ...strip...

Ah, I was looking at https://qb64phoenix.com/qb64wiki/index.p...tacommands in the wiki.

Whatever metacommands do exist for QB64(pe), I consider them non-existent if they are not easy to be discovered where one would expect to discover them.

Wouldn't one expect to find them on the metacommands page in the wiki?  Metacommand - QB64 Phoenix Edition Wiki
Reply
#7
(11-22-2022, 04:11 AM)SMcNeill Wrote:
(11-22-2022, 02:58 AM)CharlieJV Wrote:
(11-22-2022, 12:01 AM)mnrvovrfc Wrote: I guess an ordinary QB64(PE) program having $IF THESE THEN preprocessor directives, ...strip...

Ah, I was looking at https://qb64phoenix.com/qb64wiki/index.p...tacommands in the wiki.

Whatever metacommands do exist for QB64(pe), I consider them non-existent if they are not easy to be discovered where one would expect to discover them.

Wouldn't one expect to find them on the metacommands page in the wiki?  Metacommand - QB64 Phoenix Edition Wiki
Sure if that was easy to find.  I don't know where that link exists on the wiki.  Where is that link hidden?  Wherever it is, if it is fine for the majority, leave it there.  I'm not looking for that site to accommodate my needs.

It was easy for me to find, however, the Metacommands section in the Keyword Reference - By usage page.

If there is anything I loathe more than something that seems undocumented, it is inconsistent documentation.

But good documentation is a hard thing to do, especially if the technology and the process aren't really inviting  (from my perspective because of the challenges I deal with).  But I also don't see folk clamoring to bump up the quality of the documentation because for most folk, it is no fun and is often a thankless job.
Reply
#8
(11-22-2022, 04:37 AM)CharlieJV Wrote: ....Where is that link hidden?  ....

It was easy for me to find, however, the Metacommands section in the Keyword Reference - By usage page.

If there is anything I loathe more than something that seems undocumented, it is inconsistent documentation.

But good documentation is a hard thing to do, especially if the technology and the process aren't really inviting  (from my perspective because of the challenges I deal with).  But I also don't see folk clamoring to bump up the quality of the documentation because for most folk, it is no fun and is often a thankless job.

It's right there on the page that you're sharing.  You're just overlooking it, apparently.

   
Reply
#9
(11-22-2022, 05:01 AM)SMcNeill Wrote: It's right there on the page that you're sharing.  You're just overlooking it, apparently.

Yeah, those don't look at all like links to me, and even if they did, what reason would I have to click on them when it looks to me like everything is there on the one page?  I'll elaborate on all of that later.


It would be absurd for anybody to be hostile towards a wheelchair-bound individual because that individual did not attend a meeting located in a building that has no wheelchair access.

That's what I'm experiencing over here.  It is a kind of hostility that nobody could ever realise is being experienced on the other end.

Because of that, and although it may seem absurd to you, I easily forgive that and easily fall into "roll up your sleeves and kill them with kindness" mode.  I will do some reflection and actually respond with individual posts:
  • I have no choice but to post some kind of testimony about my cognitive disability (ies?) and health issue exacerbating the related challenges.  May that will clarify why: I don't see things everybody else sees; I don't understand things everybody else understands; I'm totally misunderstanding something; I'm connecting dots that really aren't connected; I'm processing information in a way that seems out to lunch; I'm totally failing at communicating what's in my head (and likely repeating myself as I try to express it coherently.)  If you can understand a little bit how my cognitive processing is screwed up, maybe you'll better understand ...
  • The origins of my OP in this thread: what I was thinking, what I was misunderstanding, my intentions
  • How the wiki really accommodates my difficulties, and where it falls flat, and why.
  • What drew me to QB64, what continues to draw me to QB64pe, how I had hoped to contribute, why and how I had to rejig contributions, and the hope I have that keeps me persisting vs throwing in the towel

Something like that.  I'm tired, so not today.

Update
After some sober second-thought: what's the point?  The path of least resistance, surrender, detachment(?) feels way better:

Note:  Due to lack of interest in BASIC Anywhere Machine by the QB64 community, and unless interest in BASIC Anywhere Machine picks up, I'm (1) suspending posting updates about BASIC Anywhere Machine in the QB64(pe) forum and (2) suspending efforts to improve BASIC Anywhere Machine's compatibility with QB64/QB64(pe).  If anybody wants to discuss BAM, I'm there for you, but I'm otherwise not bringing up my project.
Reply




Users browsing this thread: 6 Guest(s)