about summary refs log tree commit diff stats
path: root/051scenario_test.mu
Commit message (Expand)AuthorAgeFilesLines
* 3385Kartik K. Agaram2016-09-171-6/+6
* 3379Kartik K. Agaram2016-09-171-3/+3
* 3015 - more symbolic names in testsKartik K. Agaram2016-05-261-15/+15
* 2987Kartik K. Agaram2016-05-201-0/+70
* 2971Kartik K. Agaram2016-05-171-70/+0
* 2467 - rename 'string' to 'text' everywhereKartik K. Agaram2015-11-211-1/+1
* 2466 - eliminate ':string' from scenariosKartik K. Agaram2015-11-211-1/+1
* 1990 - extra ingredient for 'trace' depthKartik K. Agaram2015-08-131-1/+1
* 1868 - start using naked literals everywhereKartik K. Agaram2015-07-281-9/+9
* 1363 - rename 'integer' to 'number'Kartik K. Agaram2015-05-131-6/+6
* 1276 - make C++ version the defaultKartik K. Agaram2015-05-051-0/+70
light .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
# 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
]