Skip to content

Releases: BowLang/Bow

v0.7.1 Improved Switch Statements

07 Aug 11:09
24be101
Compare
Choose a tag to compare
Pre-release

Switch statements now properly handle breaks and returns. The calculator example can be modified to:

fun to_dec(num -str-) =dec=>
	switch num ==>
		"0" ?->
			<-- 0
		"1" ?->
			<-- 1
		"2" ?->
			<-- 2
		"3" ?->
			<-- 3
		"4" ?->
			<-- 4
		"5" ?->
			<-- 5
		"6" ?->
			<-- 6
		"7" ?->
			<-- 7
		"8" ?->
			<-- 8
		"9" ?->
			<-- 9
		other ?->
			<-- -1
	<==
<==

fun enter_num =dec=>
	str_num <-con str-< input("Enter a number 0-9: ")
	dec_num <-con dec-< to_dec(str_num)
	
	if dec_num = -1 ==>
		output("Invalid.")
		<-- enter_num
	<==
	
	<-- dec_num
<==


fun enter_calc =str=>
	calc <-con str-< input("Enter calculation (+,-,*,/): ")

	if calc != "+" && calc != "-" && calc != "*" && calc != "/" ==>
		output("Invalid.")
		<-- enter_calc
	<==
	
	<-- calc
<==

num_1 <-con dec-< enter_num
calc  <-con str-< enter_calc
num_2 <-con dec-< enter_num

result <-var dec-< 0

switch calc ==>
	"+" ?->
		result <-< num_1 + num_2
		break
	"-" ?->
		result <-< num_1 - num_2
		break
	"*" ?->
		result <-< num_1 * num_2
		break
	"/" ?->
		result <-< num_1 / num_2
		break
<==

v0.7.0 Switch Statements

05 Aug 14:55
f68b523
Compare
Choose a tag to compare
Pre-release

This release adds switch statements to Bow.

Example program (you have to run in debug mode to see final variable value 🤣):

fun to_dec(num -str-) =dec=>
	switch num ==>
		"0" ?->
			<-- 0
			break
		"1" ?->
			<-- 1
			break
		"2" ?->
			<-- 2
			break
		"3" ?->
			<-- 3
			break
		"4" ?->
			<-- 4
			break
		"5" ?->
			<-- 5
			break
		"6" ?->
			<-- 6
			break
		"7" ?->
			<-- 7
			break
		"8" ?->
			<-- 8
			break
		"9" ?->
			<-- 9
			break
		other ?->
			<-- -1
			break
	<==
<==

fun enter_num =dec=>
	str_num <-con str-< input("Enter a number 0-9: ")
	dec_num <-con dec-< to_dec(str_num)
	
	if dec_num = -1 ==>
		output("Invalid.")
		<-- enter_num
	<==
	
	<-- dec_num
<==

fun enter_calc =str=>
	calc <-con str-< input("Enter calculation (+,-,*,/): ")

	if calc != "+" && calc != "-" && calc != "*" && calc != "/" ==>
		output("Invalid.")
		<-- enter_calc
	<==
	
	<-- calc
<==

num_1 <-con dec-< enter_num
calc  <-con str-< enter_calc
num_2 <-con dec-< enter_num

result <-var dec-< 0

switch calc ==>
	"+" ?->
		result <-< num_1 + num_2
		break
	"-" ?->
		result <-< num_1 - num_2
		break
	"*" ?->
		result <-< num_1 * num_2
		break
	"/" ?->
		result <-< num_1 / num_2
		break
<==

v0.6.0 Functions

03 Aug 13:55
c916d9b
Compare
Choose a tag to compare
v0.6.0 Functions Pre-release
Pre-release

You can now declare and call your own functions and call the 2 current builtin functions: input and output.

v0.5.0 Bracketed Expressions

31 Jul 17:21
16a7b38
Compare
Choose a tag to compare
Pre-release

You can now have bracketed expression in your Bow code. Calculations follow bidmas

v0.4.0 If Statements

30 Jul 13:56
d6850b5
Compare
Choose a tag to compare
v0.4.0 If Statements Pre-release
Pre-release

You can now do if statements in Bow! The syntax is:

if condition ==>
  (stuff)
<== altif condition ==>
  (stuff)
<== alt ==>
  (stuff)
<==

v0.3.0 Variable Assignment

27 Jul 18:52
9b8ea5a
Compare
Choose a tag to compare
Pre-release

You can now re-assign variables after declaration

image

v0.2.0 Intereactive Shell

27 Jul 17:23
d80078b
Compare
Choose a tag to compare
Pre-release

You can now run Bow statements in the Bow Interactive Shell. Just run ./Bow.exe

image

v0.1.0

27 Jul 10:45
5b12851
Compare
Choose a tag to compare
v0.1.0 Pre-release
Pre-release

Run Bow files by running the executable with the file path as the first argument.
e.g.
>> ./Bow.exe hello.bow

What's Changed

New Contributors

Full Changelog: https://github.com/Coding-Cactus/Bow/commits/v0.1.0