LogicodeLang/Logicode

Multiple proposals!

Opened this issue · 16 comments

There are three four proposals here.

Proposal 1: Multiple statements in conds.

var asdf = 1
cond asdf -> [
    var abcd = 1
    var other = 110
]/[
    var abcd = 0
]
out abcd

Output: 1

Proposal 2: @ working for multiple chars at once, something like this:

out @(10001,100111,1111010)

(This can be extended to all prefix built-in commands).


Proposal 3: Null values for variables.

var x
# x is now equal to an empty binary string (or represented as [] in processing code)

Proposal 4: Boolean command.

Uses the ? symbol (prefix).

out ?10011

Output: 1

Note on Proposal 3: can't we change it to var x = void?

Also, could there be comments, like var x=1 ?assign x?

and

?This program
prints out 1.?
out 1

This is useful since I find Logicode as knotted and twisted as Brainfuck...

There's already comments, using #. So, like this:

# This is a line comment

As for your tip on Proposal 3, sure, why not. I personally favour my own proposal, though.

IMO proposal 3 should be var foo just makes it ininitialized (i.e. empty)

@somebody1234 Oh yeah, that could work.

There's already comments, using #. So, like this:

it's not in the wiki, how do I know??

var foo and var foo = void and var foo = 0 all make sense, however var foo = 0 means something quite different..

@testitem Yeah, I'm still busy making the docs from scratch... sorry if it's under-documented.

oh. wanna me to help you?

P.S. do we need this?? https://testitemqlstudio.visualstudio.com/Logicode

@testitem What is that?

Well just a branched version of Logicode... I work on that most of the time and I get ideas from the Github repo's code

So Proposal Number 3 is done, and as "var foo = "?

@testitem That's changed to var foo (so it's done). Also, Proposal 1 is done, as well as Proposal 4. Which just leaves Proposal 2, which I'll get around to later.

Wait what is ? again?

? is actually now a random bit... I forgot about that, so I have to change the boolean thingo to *.

No what does it DO?

? generates a random bit, so 0 or 1.

e.g.

var x = ?
out x

Output: 0 or 1

* is a boolean (i.e. it generates 1 if the variable is non-zero, else it generates 0)

e.g.

var x = *100
out x

Output: 1

var x = *000
out x

Output: 0

Oh Thanks.