Created
September 17, 2013 14:01
-
-
Save mamcx/6594708 to your computer and use it in GitHub Desktop.
Ideas for my own language
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
timerChan = chanel(out=chanx:Date) | |
await def: | |
time.Sleep(10) | |
timerChan |> time.Now() # send time on timerChan | |
#Do something else; when ready, receive. | |
#Receive will block until timerChan delivers. | |
#Value sent is other goroutine's completion time. | |
completedAt <| timerChan | |
for True: | |
if v <? ch1: | |
print("channel 1 sends", v) | |
elif v <? ch2: | |
print("channel 1 sends", v) | |
else: | |
print("neither channel was ready") | |
def save:Bool | Err | |
if not(self.valid): | |
@error('Invalid') | |
return True | |
saved | err = save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment