« first day (24 days earlier)    last day (14 days later) » 

7:28 AM
@ASCII-only Hello!
 
Hello
 
Ayyy
 
7:43 AM
Hello, @ASCII-only?
 
@Qwerp-Derp ?
 
So I have this for my cond thingo:
"Condition": [
    rCondition,
    "TopLevelExpression",
    rLambda,
    [
        "|",
        [
            "1",
            ["|", "Variable", "Out", "TopLevelExpression"],
            rOr,
            ["|", "Variable", "Out", "TopLevelExpression"]
        ], [
            "1", rOpenBracket,
            ["+", ["|", "Variable", "Out", "TopLevelExpression"]],
            rMultilineCond,
            ["+", ["|", "Variable", "Out", "TopLevelExpression"]],
            rCloseBracket
        ]
    ]
This is my code:
var asdf = 100
cond asdf -> [
out 111
]/[
out 100
]
Traceback (most recent call last):
  File "logicode.py", line 555, in <module>
    Run(code)
  File "logicode.py", line 512, in Run
    result = statement[0](scope)
  File "logicode.py", line 72, in <lambda>
    return lambda scope: scope[result[0]]
  File "logicode.py", line 230, in __getitem__
    return self.parent[key]
KeyError: 'cond'
That's the error
I don't think the thing matches at all
 
Oh, you're not matching newlines
 
Wait what
Ah yeah whoops
Revised code:
"Condition": [
    rCondition,
    "TopLevelExpression",
    rLambda,
    [
        "|",
        [
            "1",
            ["|", "Variable", "Out", "TopLevelExpression"],
            rOr,
            ["|", "Variable", "Out", "TopLevelExpression"]
        ], [
            "1", rOpenBracket,
            ["+", ["|", "CommandSeparator", "Variable", "Out", "TopLevelExpression"]],
            rMultilineCond,
            ["+", ["|", "CommandSeparator", "Variable", "Out", "TopLevelExpression"]],
            rCloseBracket
Which still doesn't work
And still returns KeyError: cond
@ASCII-only?
Hello? @ASCII-only are you there?
 
8:11 AM
Hmm
 
Ah
So the thing is, it doesn't even reach the condition function at all
 
Um
yeah, the function only runs after a successful parse
 
Ah
So it hasn't parsed properly...
Well, it's either that or my variable matcher is going crazy
Which is like this:
"Variable": [
        rVariable, rName,
        ["?", rEquals, "TopLevelExpression"]
    ]
 
Looks fine
does var asdf = 100 work
 
8:34 AM
I'm not sure... better check it out
Yeah, the Variable thingo looks like it's borked
@ASCII-only Hello?
 
I have no idea why it's borked
 
Ah
It's parsing "asdf" as 0
Oh BTW this is my Variable func:
 
uh what
 
name = result[1]
try:
    value = result[3]
except:
    value = lambda n: 0
return lambda scope: scope.set(name, value(scope))
 
do a print(result)
 
8:54 AM
OK, turns out it isn't a problem with the variable function thingo
@ASCII-only Hello?
 
@Qwerp-Derp ?
 
Yeah, it's the problem with the cond function
I don't know how to fix it
What do I do?
Should I put it on C9?
 
yeah (but I may not be able to access it for a quite a while)
 
Why not?
Ah yeah the credit card thingo right?
 
9:08 AM
What
 
Accounts created before July 15 don't need credit card validation
 
Ah
So what is it then?
 
It's just that my laptop battery is almost flat ;_;
 
Ah
:(
 
9:40 AM
@ASCII-only One more error...
 
10:03 AM
@Qwerp-Derp where
 
Ummm
The code runs properly, but there's an error at the end, for some reason
Traceback (most recent call last):
  File "logicode.py", line 562, in <module>
    Run(code)
  File "logicode.py", line 519, in Run
    result = statement[0](scope)
  File "logicode.py", line 187, in <lambda>
    return lambda scope: if_true(scope) if 1 in condition(scope) else if_false(scope)
  File "logicode.py", line 182, in <lambda>
    if_true = lambda scope: list(filter(None, map(lambda expression: expression(scope), expressions_true)))[-1]
IndexError: list index out of range
At the end of the code
The 111 outputs normally
This is my revised code:
def Condition(result):
    condition = result[1]
    body = result[3][0]
    if isinstance(body[1], list):
        expressions_true = map(lambda l: l[0], body[1])
        expressions_false = map(lambda l: l[0], body[3])
        if_true = lambda scope: list(filter(None, map(lambda expression: expression(scope), expressions_true)))[-1]
        if_false = lambda scope: list(filter(None, map(lambda expression: expression(scope), expressions_false)))[-1]
    else:
        if_true = body[0]
        if_false = body[2]
(And I figured out why the cond wasn't searching properly before, I was being stupid)
@ASCII-only Are you there?
 
Sorry, was afk
This is a simple problem :D Use ([ None ] + list(filter(None, map(lambda expression: expression(scope), expressions_true))))[-1] for if_true and if_false
 
Ah
Yay, it works!
Awrite, that's most of the new features down
 

« first day (24 days earlier)    last day (14 days later) »