about summary refs log tree commit diff stats
path: root/archive/1.vm/continuation1.mu
blob: 8276e188436025ccfbc77cec24199b74f4985cd3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Example program showing that 'return-continuation-until-mark' can 'pause' a
# function call, returning a continuation, and that calling the continuation
# can 'resume' the paused function call.
#
# To run:
#   $ git clone https://github.com/akkartik/mu
#   $ cd mu
#   $ ./mu continuation1.mu
#
# Expected output:
#   1

def main [
  local-scope
  k:continuation <- call-with-continuation-mark 100/mark, create-yielder
  x:num <- call k  # should return 1
  $print x 10/newline
]

def create-yielder -> n:num [
  local-scope
  load-inputs
  return-continuation-until-mark 100/mark
  return 1
]
="p">) { check_transcription("T", "A"); } static void test_rna_complement_of_adenine_is_uracil(void) { check_transcription("A", "U"); } static void test_rna_complement(void) { check_transcription("ACGTGGTCTTAA", "UGCACCAGAAUU"); } int main(void) { UnityBegin("test/test_rna_transcription.c"); RUN_TEST(test_empty_rna_sequence); RUN_TEST(test_rna_complement_of_cytosine_is_guanine); RUN_TEST(test_rna_complement_of_guanine_is_cytosine); RUN_TEST(test_rna_complement_of_thymine_is_adenine); RUN_TEST(test_rna_complement_of_adenine_is_uracil); RUN_TEST(test_rna_complement); return UnityEnd(); }