« first day (2398 days earlier)      last day (110 days later) » 

12:40 AM
With very simple concepts I can do that.
I've been picking apart the examples and understand them when they are basic.
My hurdle is the pedantic naming and having to understand each miniscule step. Most of the time I don't think about what is occurring and it just makes sense.
In concept I understand that it is essentially left >= right.
That formula is relatively simple.
But I forget that left itself is an expression that needs to be created.
public static void ExampleForMDoerner()
{
    var left = Expression.Constant(5);
    var right = Expression.Constant(3);

    var body = Expression.GreaterThanOrEqual(left, right);

    var expr = Expression.Lambda<Func<bool>>(body).Compile();

    var result = expr.Invoke();
}
The nonsense equation () => 5 >= 3 for my example.
It helps me see the various parts.
When looking at the second code example for Overview.
public static void Overview()
{
    var value = Expression.Parameter(typeof(int), "value");

    var result = Expression.Parameter(typeof(int), "result");

    var label = Expression.Label(typeof(int));

    var block = Expression.Block(
            new[] { result },
            Expression.Assign(result, Expression.Constant(1)),
            Expression.Loop(
                Expression.IfThenElse(
                    Expression.GreaterThan(value, Expression.Constant(1)),
                    Expression.MultiplyAssign(result,
That results, based on what I understand, in:
public static int OverviewRewritten(int param)
{
    int value = param;
    int result;
    {
        result = 1;

        do
        {
            if (value > 1)
            {
                result *= value--;
            }
            else
            {
                break;
            }
        } while (true);
    }

    return result;
}
Invoked as int fact = OverviewRewritten(5);.
My sticking point with the Expression.Loop is where/how the loop is exited.
Thinking about it a bit more It could either be a Do... While Loop or even a While... Loop as they are almost the same. The exception that Do...While is always executed at least once, since the condition is checked at the end.
I can't quite grok how to represent LabelTarget and where it is in the code.
 
1:21 AM
[Zomis/FactorioMods] build for commit 03792035 on search-engine: This commit cannot be built
BUILD FAILURE!
 
@IvenBach Mumble mumble Expression.Break(...) "Creates a GotoExpression representing a break statement.". It's not a literal break statement.
goto statement goes directly to the labeled statement FooBar:
 
1:56 AM
Expressions.GotoExpression is used for all the jump statements: break, continue, goto, and return.
 
2:15 AM
public static int OverviewRewritten(int param)
{
    int value = param;
    int result;
    {
        result = 1;

        do
        {
            if (value > 1)
            {
                result *= value--;
            }
            else
            {
                goto unnamedLabel;
            }
        } while (true);
    }

unnamedLabel:
    return result;
}
Including label is what I get. Same resulting value though.
Digging through the other jump statements then I'm done. Brain's toast.
 
3:00 AM
Expression.Loop(...) has 3 parts.
Body makes sense. break and continue makes me knee-jerk stumble.
If execution is inside a loop...
Trying to Logically thinking this through:
A loop is an iteration that can be used by do, for, foreach, in, and while.
Each of those constructs can break; and continue execution immediately following the block.
They can also continue;. For a do and while statement it will bring execution to evaluate the boolean condition. On for and foreach, in it will take it to the next iteration (implicitly calling IEnumerator.MoveNext in the process).
That is why it exists for any loop.
Now to figure out where to place it in my rewritten example.
Continue method example rewritten based on what I understood:
public static void ContinueExpressionRewritten(int param)
{
    int count = param;
    {
        continueLabel:

        if (count > 3)
        {
            goto breakLabel;
        }

        ++count;

        Console.WriteLine("Loop");

        goto continueLabel;

        --count;
    }

breakLabel:;
}
The Expression.PreDecrementAssign(...) didn't make any sense. It's corresponding --count confirms it.
Expression.Loop method is the same as Overview already done.
Goto method and Return method are also the same. Rewritten form:
public static void GoToExpressionRewritten()
{
    Console.WriteLine("GoTo");
    goto unnamedLabel;
    Console.WriteLine("Other Work");
unnamedLabel:;
}
@M.Doerner Is what I've understood close enough for a first attempt?
 
 
3 hours later…
6:39 AM
 
7:18 AM
Besides grammar and parsing what are expression trees good for?
 
 
3 hours later…
10:31 AM
@IvenBach Evaluating/Executing whatever they represent. Analyzing the tree is very useful for tools like Rubberduck or IntelliJ IDEA.
 
11:17 AM
Ktor bot started
 
 
3 hours later…
2:22 PM
Hey everyone! Have a nice day
 
2:40 PM
@Marc-Andre Likewise! I've spent the day so far with doing laundry, dishes, and doing some work on @Duga/@Greger
I love having a day off in the middle of the week
Next up I think I will be recording another pyblock episode
 
Happy that you're having a nice day!
 
 
1 hour later…
3:51 PM
Recorded an episode ...
it's... one and a half hours long.
dammit
Title will be "(Not?) getting sidetracked"
 
4:32 PM
@SimonForsberg to understand I going to need more exp and learning on my own part. Then see it in use for my #AHA moment.
 
4:43 PM
@Vogel612 Hahaha, welcome to my world xD
@IvenBach Are you familiar with the Brainfuck language?
 
5:00 PM
@IvenBach I think you do yourself a bit of a disservice jumping in to expressions aimed to cover everything in C#.
 
Thank you for your feedback! I didn't pay much attention to the code of Person; you'll notice that it doesn't even have a setId() or implement equals() and hashCode(). — Matthias Braun 8 hours ago
> answered Sep 13 '14 at 13:58
 
You should look at something much simpler, e.g. formulas with +, * and parentheses, like in the AdventOfCode problem.
 
5:16 PM
@SimonForsberg I am not.
It exists. That's the extent of my knowledge.
@M.Doerner Day18?
AoC. Yet another loose string I left dangling.
 
That and the next day, which basically makes you write a simple parser generator.
 
Haven't tried Day19 yet. Saw it but haven't had time to attempt.
 
This reminds me that I want to continue to redo aoc in Rust at some point.
Definitely do 18 first.
 
Day18 as expression trees?
 
5:42 PM
Yep, parsing the input into an expression tree, with the appropriate expression types (I used three different ones.), and then evaluating the expression.
Once you succeed doing that in this reduced scenario, approaching other parsing scenarios should be simpler to get your head around.
 
6:08 PM
Will try. Hope you don't mind the eventual questions when I do.
 
 
2 hours later…
8:28 PM
[Zomis/Duga] Zomis pushed commit cc9e67a5 to ktor: Add Stack Exchange API class
[Zomis/Duga] Zomis pushed commit 1be4dacd to ktor: Change weekly update task schedule
[Zomis/Duga] Zomis pushed commit 7c0f496b to ktor: Expand poster API
[Zomis/Duga] Zomis pushed commit d26c85ef to ktor: Add (but don't use) question and comment scanning tasks
 
9:23 PM
@IvenBach The reason I mention Brainfuck is that a common exercise is to implement a Brainfuck parser/interpreter. For the purposes of understanding expression trees, I think it is an excellent exercise.
 
9:42 PM
PSA all @Duga users: Make sure that your webhook is using HTTPS!
2
 
 
2 hours later…
11:52 PM
[Zomis/Duga/ktor] build 13 Build failed.
[Zomis/Duga] build for commit d26c85ef on ktor: This commit cannot be built
BUILD FAILURE!
 

« first day (2398 days earlier)      last day (110 days later) »