Closed hanyuone closed 8 years ago
Oh yay more syntax, I'll work on it once I get back on by laptop.
Multiline circuits looks like the bigger feature here, once that's done it should work fine since circuits have their own scope anyway :P
While we're on the topic of improving syntax, this doesn't work:
a[t][h]
We should probably improve the parser so that this works.
I'll work on this bit - I just have no idea where to start.
Uh... isn't there a "command separator" like ; as in Python? This would make it easier because then everything can first be compressed to circ test(a,b)->var in_circ=a&b;in_circ+1
. The parser would split it and recursively parse them.
And isn't there a "return command" to specify the parser WHAT to return from a circuit?
@DerpfacePython Should be simple, I'll do it tomorrow @testitem That should parse as:
circ test(a,b)->var in_circ=a&b
in_circ+1
IMO
@DerpfacePython What do you think about having a command separator though?
Well the com sep shouldn't be as common as in C++ and like that, one-per-line
A command separator would be nice, but IMO we should have both multi-line functions and command separators.
Well MLFs could work by compressing the code block in the brackets.
@DerpfacePython So we use ;
for command separator?
@somebody1234 Ummm... yeah, sure, why not. I'm thinking of a better separator, though.
Maybe use |
as a separator, change OR to ?
and change the random bit to *
?
IDK, |
is or in most languages, just change the regexes when you've decided
But ;
seems really mainstream...
Also, cond
s aren't supported in circuits.
@DerpfacePython Yeah, what about cond
s and circuits
So something like this:
circ asdf(a)->[
var a=0+a[t]
cond a->asdf(a)/0
]
returns a KeyError
.
Oh, you want cond
s, brb fixing
EDIT: @DerpfacePython should be fixed now
Also, [t]
doesn't work - something like
var a=1110
out a[t]
outputs 0
instead of 110
.
@DerpfacePython Oh wait whoops
What? I thought [t]
was all bits other than the 1st one.
@DerpfacePython Sorry about that, will fix when I get home in ~3h
Nah, DW about the last problem - I fixed it.
@DerpfacePython Actually fixed now
I would like to suggest a new feature: variables in circuits.
They would work like this:
Which would then output
11
.