Replies: 3 comments 2 replies
-
To add to the reasons this should be added: it would also allow for variables/objects/signals/etc named "pass". |
Beta Was this translation helpful? Give feedback.
-
There is a suggestion to use As for using |
Beta Was this translation helpful? Give feedback.
-
This would be very confusing when writing code examples and pseudocode, how would you denote actually omitting part of the code as distinct from I also consider non-word based control statements confusing and unhelpful, |
Beta Was this translation helpful? Give feedback.
-
Python has the Ellipsis object, which is often used for slicing multi-dimensional containers. Another common use of it, and one that I really like a lot, is as a no-op placeholder in functions you have yet to write code for. Often when I'm blocking out my function structures in a Python program, I'll quickly write out something like
Personally, I'd love to be able to do the same thing in GDScript. If I'm adding functions to my classes for handling taking damage, I could type something like
then return to fill in the actual code later. I imagine it'd be equivalent to
pass
in this context, as it is in Python, but:...
overpass
to me - when I'm at this stage of coding I want something I can very quickly bang out.pass
, and thus easier for someone not familiar with programming to quickly understand. Ellipsis are used widely in English (and other languages too?) to take the place of words when there's silence. When people see this, they might be more likely to intuitively understand that it means there's nothing here/it's a placeholder and stuff should be written here. (Maybe a stretch.)I think I've spoken to at least one other person who said they would appreciate this bit of syntactic sugar, and maybe there are even more out there? Perhaps if there were other valid uses we could come up with for an Ellipsis literal and/or object, it could make sense to consider further? For now, I mostly just think it'd be really nice to be able to tap-tap-tap in a no-op 😅
Beta Was this translation helpful? Give feedback.
All reactions