File: test-function_type.1.R

package info (click to toggle)
r-cran-lambda.r 1.2.4-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 284 kB
  • sloc: sh: 9; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 271 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
rm(list=ls())

assert('function_type_1', {
  seq.gen(start) %::% a : Function
  seq.gen(start) %as%
  {
    value <- start - 1
    function() {
      value <<- value + 1
      return(value)
    }
  }
  seal(seq.gen)

  act <- seq.gen(1)
  ('function' %in% class(act))
})