|
honey the codewitch wrote: it wouldn't be pretty.
I don't care how ugly it might be in the background. That's the beauty of high level languages.
|
|
|
|
|
I should have been more clear.
It will probably add significant bloat and maybe even be a performance hit - not something you'd necessarily want to have happen behind your back - if it's even possible to do as I said.
One problem is if your code yields in a catch block as well. You can't goto into or out of one, IIRC so I don't know how you'd break that up.
It may not be possible after all, and even if it was you'd probably have to duplicate the code in your catch blocks N times where N is the number of yields or something (not enough coffee to work it all out yet)
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
He probably said that before "async/await"
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
He did indeed. It was like fifteen years ago or so.
You also couldn't combine yield and async in the beginning.
|
|
|
|
|
honey the codewitch wrote: my lexer generator generates code in a language
I presume you really do mean that it is yours.
That is the problem of course with doing your own code generation. Of course your real choices are to update that tool or stop using iterators.
Myself I would probably just not use iterators. There probably isn't that much impacted code.
|
|
|
|
|
Maybe I wasn't clear. In order to update the tool, I need to port code from stuff that uses iterators to stuff that doesn't.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Ok? Not sure I see how that changes what I suggested?
Porting code always involves changes. Otherwise it would just be copying code.
|
|
|
|
|
It's really difficult to port iterators away to non-iterator code for anything non-trivial. The necessary transformation is pretty complicated, and involves building state machines and using a bunch of gotos.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
honey the codewitch wrote: away to non-iterator code for anything non-trivial.
Do we have a different definition of iterator? What I am thinking of is the following. No idea how you can get to a state machine from that.
Iterators - C# | Microsoft Learn[^]
|
|
|
|
|
Yep, that's iterators.
Note that there is no intrinsic .NET support for this feature. It is a feature of the C# compiler, which works by transforming the code.
The C# compiler transforms it into a state machine based coroutine by
A) hoisting local variables to make them members of the IEnumerator implementation.
B) Implementing MoveNext() such that wherever there's a yield, that's a new state in the state machine. Because the routine actually returns at that point. When you call it again, it is "restarted" where it left off using the state machine.
All iterators are state machines once the compiler is done mangling that code.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
|
They are usually sent out well before now, but I haven't received such an email yet.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
I got it about 12:30 PM today, Eastern Standard Time.
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated.
I’m begging you for the benefit of everyone, don’t be STUPID.
|
|
|
|
|
The last one I received was at 11:30am yesterday (PST)
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Did you remember to pay the subscription fee?
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Wordle 881 4/6*
🟨🟨⬛⬛⬛
🟩🟨🟨⬛⬛
🟩🟨⬛🟨🟨
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 881 4/6
🟨🟨⬜⬜⬜
🟨⬜🟩⬜🟨
⬜🟩🟩⬜🟨
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 881 3/6
⬛🟨🟨⬛⬛
⬛🟩🟩🟨🟩
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 881 3/6
⬜⬜🟨🟨⬜
⬜🟨⬜⬜🟩
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 881 4/6
🟨⬜🟨⬜⬜
🟨🟨⬜🟨⬜
⬜🟩🟩🟩🟩
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 881 6/6
🟨⬜⬜⬜⬜
⬜⬜⬜⬜⬜
⬜🟨🟨⬜⬜
⬜🟨🟨⬜🟩
🟨🟩🟩⬜🟩
🟩🟩🟩🟩🟩
Phew.
|
|
|
|
|
⬜🟨🟨⬜⬜
⬜⬜⬜🟨🟨
🟨🟩⬜🟨🟩
⬜🟩🟩🟩🟩
🟩🟩🟩🟩🟩
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|
Wordle 881 4/6
🟨🟨⬛🟨⬛
🟨🟩🟨⬛⬛
🟨🟩🟩⬛🟩
🟩🟩🟩🟩🟩
Ok, I have had my coffee, so you can all come out now!
|
|
|
|
|
Wordle 881 3/6*
⬜⬜🟨🟨⬜
🟩🟨⬜🟨⬜
🟩🟩🟩🟩🟩
Happiness will never come to those who fail to appreciate what they already have. -Anon
And those who were seen dancing were thought to be insane by those who could not hear the music. -Frederick Nietzsche
|
|
|
|
|