GOV Script Example.gov

From MicroCommons
Jump to navigation Jump to search
#!/sbin/gov
## Note that sbin is used here for compatibility with the current Kernel (1:3:0).  I had misunderstood sbin as "Statically Compiled Binaries", when in actuality it is for administrative binaries.  
## Also, this is a comment.  
#/ This 
   is
   a
   multiline
   comment
/#
## Generally, it is preferred practice to use multiline comments only for code, and to have descriptions (such as this) written with two hashes ("##")
# This is another comment
## A single hash ("#") should only be used for commenting out code.  
## 
## Also, know that all GOV scripts start out cd'd to /Registry
## 
## Alrighty, here we go!  :) 

## The following will check to see if all provinces are using the same longzone.  If they are, then the government will use it; else, the government will use SpaceTime.  
IF
    Provinces/All/LongZone != ?  ## If isnot undefined (GOV uses balanced ternary, with the following symbols: - ? + (These are open to discussion))
  THEN
    Govt/All/LongZone = Provinces/All/LongZone
  ELSE
    Govt/All/LongZone = {{SpTime}}  ## Apply the standard specified in /Standards/SpTime.txt  ||  Standards are plain-text files that cannot be expressed in code.  Their use is discouraged, and the more time a piece of legislation has been in existence, the more its Standards (if any) will be converted into code (just given the nature of the open source development system we're using).  
FI

## There!  Simple enough.  :) 
## Notice the indentation practices.  
## Notice also how keys are in all CAPS
## Notice also the camel-cased capitalization scheme of the directories
## 
## Here's the same code again, this time without comments: 

IF
    Provinces/All/LongZone != ?
  THEN
    Govt/All/LongZone = Provinces/All/LongZone
  ELSE
    Govt/All/LongZone = {{SpTime}}
FI

## If you've ever messed around in a Linux terminal, you've probably noticed that this is quite reminiscent of bash.  Well, it is.  And the reason why that works well is because managing a GOV registry is like managing /proc on a UNIX-like system.  Your legislation will literally depend on GNU CoreUtils (or an alternative).  :P
## I plan to write the interpreter in bash as well.  
## 
## There's still a lot to be done for this language.  I want it to be developed as an open standard, perhaps on github.  We'll get to that soon enough.  :) 
## We may postpone getting GOV workable until we have our legis system functional in plain English, so be aware of that.  
## You can go ahead and start it on git right away if you're that interested in it.  In that case, please let me in as someone who can manage what commits get through.  
## 
## GOV is currently licensed CC-BY-SA 3 unported, (C) 2013
## This particular GOV script carries the same license.  
## 
## Well, that's all for this example.  I am looking forward to developing some legislation with you all.  :) 
##