DulLabs / bhai-lang

A toy programming language written in Typescript
https://bhailang.js.org/
MIT License
3.97k stars 499 forks source link

Add delay (RUKO ZARA SABAR KRO) #148

Closed shmehdi01 closed 2 years ago

shmehdi01 commented 2 years ago

Description

Description Add delay as RUKO ZARA SABAR KRO

Domain

Bhai Lang

Type of Contribution

Enhancement

Code of Conduct

frankhart2018 commented 2 years ago

@shmehdi01 bhai this seems to be something which should be done in a package which can be imported like time in python, so that users can do something like time.sleep(10). Also, zara is an arbitrary time, I would rather propose - "Ruko bhai 10 seconds" where the last token can be seconds, milliseconds, minutes, etc.

amalgawa commented 2 years ago

ruko zara could be the function name and sabar_karo could be the variable name. i.e ruko zara (sabar_karo) where sabar_karo is time in seconds.

NiinS commented 2 years ago

"Ruko bhai 10 seconds"

Fair point.. Can we also look at using 'pal' as the well known synonym for seconds in the spirit of Bhailang.

e.g.

"Ruko bhai do pal" is same "Ruko bhai 2 seconds"

swapnilbarwat commented 2 years ago

"Ruko bhai 10 seconds"

Fair point.. Can we also look at using 'pal' as the well known synonym for seconds in the spirit of Bhailang.

e.g.

"Ruko bhai do pal" is same "Ruko bhai 2 seconds"

I feel this would be little too much to remember and chances are people will prefer default implementation. Like dict.get(key) method in Python. dict[key] is more easy to remember than the former one.

aniketsingh0104 commented 2 years ago

No current plans to add this feature in this language as this will lead to more complexities in this toy language.