Log In  

Just updated to v0.2.5e, and found that it breaks a number of my tweetcarts.
The issue specifically seems to be that this shortcut is no longer supported:

if(...)do
--thing1
--thing2
--etc.
end

Now to make things work, I have to replace the "do" with "then". Not a huge change, but it does require a couple more characters, and every one counts when dealing with strict character limits.

P#122907 2022-12-23 21:33 ( Edited 2022-12-23 21:35)

1

abusing the single line if to execute a multi-line statement? Bold 😜

P#122909 2022-12-23 22:18
1

Well, I saw somebody else saying it worked, I just followed their lead. ;)

P#122928 2022-12-24 06:30 ( Edited 2022-12-24 06:30)

what was the problem with "DO" statment. it felt reasonable AND readable. why change...

P#122932 2022-12-24 13:30 ( Edited 2022-12-24 13:31)
1

it’s not that do was changed, but that the single-line if(condition) stuff is now implemented in a more robust way than before, and that has consequences on this hack.

P#122945 2022-12-24 17:54 ( Edited 2022-12-24 17:54)

I agree with @JadeLombax. The new version should support all the nifty little shortcuts everyone has found - unless there is a strong reason not to. Gold star to support, @zep.

And I rather like the idea of being able to create a repeat loop within a comparison.

P#122956 2022-12-24 21:13

I would actually posit that this is a bug. Technically, in most languages, you can extend a single-line statement by starting a multi-line block.

Hey @zep, can the parser detect a 'do' and then read until its 'end' instead of the eol?

Actually, I imagine you could just detect the 'do' as the first thing after the parens and parse it as a 'then'. Although that would be a cheap shortcut that would only work on the first 'do', whereas a robust fix would be to let any 'do' on the line stop triggering the 'if()...eol' behavior until its associated 'end'.

P#123181 2022-12-28 13:06 ( Edited 2023-01-01 07:12)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-19 15:27:42 | 0.035s | Q:20