R Under development (unstable) (2024-02-16 r85931 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library("R.rsp") R.rsp v0.46.0 successfully loaded. See ?R.rsp for help. > library("R.oo") Loading required package: R.methodsS3 R.methodsS3 v1.8.2 (2022-06-13 22:00:14 UTC) successfully loaded. See ?R.methodsS3 for help. R.oo v1.26.0 (2024-01-24 05:12:50 UTC) successfully loaded. See ?R.oo for help. Attaching package: 'R.oo' The following object is masked from 'package:R.methodsS3': throw The following objects are masked from 'package:methods': getClasses, getMethods The following objects are masked from 'package:base': attach, detach, load, save > > d <- RspConstruct() > print(d) character(0) attr(,"class") [1] "RspConstruct" "RspObject" "character" RspConstruct: > > classes <- getKnownSubclasses(RspConstruct) > print(classes) [1] "RspCode" "RspCodeChunk" "RspComment" [4] "RspCopyDirective" "RspCutDirective" "RspDirective" [7] "RspElseDirective" "RspEndcopyDirective" "RspEndcutDirective" [10] "RspEndifDirective" "RspErrorDirective" "RspEvalDirective" [13] "RspExpression" "RspIfDirective" "RspIfeqDirective" [16] "RspIfneqDirective" "RspIncludeDirective" "RspIntegerDirective" [19] "RspLogicalDirective" "RspMetaDirective" "RspNumericDirective" [22] "RspPageDirective" "RspPasteDirective" "RspStringDirective" [25] "RspText" "RspUnknownDirective" "RspUnparsedDirective" [28] "RspUnparsedExpression" "RspVariableDirective" "RspVoid" > for (class in classes) { + clazz <- Class$forName(class) + object <- newInstance(clazz) + print(object) + + ## FIXME: Should RspExpression:s support asRspString()? + if (! class %in% c("RspExpression", "RspUnparsedExpression")) { + str <- asRspString(object) + print(str) + } + } character(0) attr(,"class") [1] "RspCode" "RspExpression" "RspConstruct" "RspObject" [5] "character" attr(,"echo") [1] FALSE RspCode: RspString: Content type: NA Language: NA Metadata to available. Number of characters: 0 Number of lines: 0 ############################################################################## character(0) attr(,"class") [1] "RspCodeChunk" "RspCode" "RspExpression" "RspConstruct" [5] "RspObject" "character" attr(,"echo") [1] FALSE attr(,"return") [1] FALSE RspCodeChunk: RspString: Content type: NA Language: NA Metadata to available. Number of characters: 0 Number of lines: 0 ############################################################################## character(0) attr(,"class") [1] "RspComment" "RspConstruct" "RspObject" "character" RspComment: RspString: Content type: NA Language: NA Metadata to available. Number of characters: 0 Number of lines: 0 ############################################################################## [1] "copy" attr(,"class") [1] "RspCopyDirective" "RspCutDirective" "RspDirective" "RspConstruct" [5] "RspObject" "character" RspCopyDirective: copy RspString: Content type: NA Language: NA Metadata to available. Number of characters: 9 Number of lines: 1 ############################################################################## <%@copy%> [1] "cut" attr(,"class") [1] "RspCutDirective" "RspDirective" "RspConstruct" "RspObject" [5] "character" RspCutDirective: cut RspString: Content type: NA Language: NA Metadata to available. Number of characters: 8 Number of lines: 1 ############################################################################## <%@cut%> character(0) attr(,"class") [1] "RspDirective" "RspConstruct" "RspObject" "character" RspDirective: RspString: Content type: NA Language: NA Metadata to available. Number of characters: 0 Number of lines: 0 ############################################################################## [1] "else" attr(,"class") [1] "RspElseDirective" "RspDirective" "RspConstruct" "RspObject" [5] "character" RspElseDirective: else RspString: Content type: NA Language: NA Metadata to available. Number of characters: 9 Number of lines: 1 ############################################################################## <%@else%> [1] "endcopy" attr(,"class") [1] "RspEndcopyDirective" "RspEndcutDirective" "RspDirective" [4] "RspConstruct" "RspObject" "character" RspEndcopyDirective: endcopy RspString: Content type: NA Language: NA Metadata to available. Number of characters: 12 Number of lines: 1 ############################################################################## <%@endcopy%> [1] "endcut" attr(,"class") [1] "RspEndcutDirective" "RspDirective" "RspConstruct" [4] "RspObject" "character" RspEndcutDirective: endcut RspString: Content type: NA Language: NA Metadata to available. Number of characters: 11 Number of lines: 1 ############################################################################## <%@endcut%> [1] "endif" attr(,"class") [1] "RspEndifDirective" "RspDirective" "RspConstruct" [4] "RspObject" "character" RspEndifDirective: endif RspString: Content type: NA Language: NA Metadata to available. Number of characters: 10 Number of lines: 1 ############################################################################## <%@endif%> [1] "error" attr(,"class") [1] "RspErrorDirective" "RspDirective" "RspConstruct" [4] "RspObject" "character" RspErrorDirective: error RspString: Content type: NA Language: NA Metadata to available. Number of characters: 10 Number of lines: 1 ############################################################################## <%@error%> [1] "eval" attr(,"class") [1] "RspEvalDirective" "RspDirective" "RspConstruct" "RspObject" [5] "character" RspEvalDirective: eval RspString: Content type: NA Language: NA Metadata to available. Number of characters: 9 Number of lines: 1 ############################################################################## <%@eval%> character(0) attr(,"class") [1] "RspExpression" "RspConstruct" "RspObject" "character" RspExpression: [1] "if" attr(,"class") [1] "RspIfDirective" "RspDirective" "RspConstruct" "RspObject" [5] "character" RspIfDirective: if RspString: Content type: NA Language: NA Metadata to available. Number of characters: 7 Number of lines: 1 ############################################################################## <%@if%> [1] "if" attr(,"class") [1] "RspIfeqDirective" "RspIfDirective" "RspDirective" "RspConstruct" [5] "RspObject" "character" attr(,"test") [1] "equal-to" RspIfeqDirective: if RspString: Content type: NA Language: NA Metadata to available. Number of characters: 23 Number of lines: 1 ############################################################################## <%@if test="equal-to"%> [1] "if" attr(,"class") [1] "RspIfneqDirective" "RspIfeqDirective" "RspIfDirective" [4] "RspDirective" "RspConstruct" "RspObject" [7] "character" attr(,"test") [1] "equal-to" attr(,"negate") [1] TRUE RspIfneqDirective: if RspString: Content type: NA Language: NA Metadata to available. Number of characters: 37 Number of lines: 1 ############################################################################## <%@if test="equal-to" negate="TRUE"%> [1] "include" attr(,"class") [1] "RspIncludeDirective" "RspDirective" "RspConstruct" [4] "RspObject" "character" RspIncludeDirective: include RspString: Content type: NA Language: NA Metadata to available. Number of characters: 12 Number of lines: 1 ############################################################################## <%@include%> [1] "integer" attr(,"class") [1] "RspIntegerDirective" "RspNumericDirective" "RspVariableDirective" [4] "RspDirective" "RspConstruct" "RspObject" [7] "character" RspIntegerDirective: integer RspString: Content type: NA Language: NA Metadata to available. Number of characters: 12 Number of lines: 1 ############################################################################## <%@integer%> [1] "logical" attr(,"class") [1] "RspLogicalDirective" "RspVariableDirective" "RspDirective" [4] "RspConstruct" "RspObject" "character" RspLogicalDirective: logical RspString: Content type: NA Language: NA Metadata to available. Number of characters: 12 Number of lines: 1 ############################################################################## <%@logical%> [1] "meta" attr(,"class") [1] "RspMetaDirective" "RspStringDirective" "RspVariableDirective" [4] "RspDirective" "RspConstruct" "RspObject" [7] "character" RspMetaDirective: meta RspString: Content type: NA Language: NA Metadata to available. Number of characters: 9 Number of lines: 1 ############################################################################## <%@meta%> [1] "numeric" attr(,"class") [1] "RspNumericDirective" "RspVariableDirective" "RspDirective" [4] "RspConstruct" "RspObject" "character" RspNumericDirective: numeric RspString: Content type: NA Language: NA Metadata to available. Number of characters: 12 Number of lines: 1 ############################################################################## <%@numeric%> [1] "page" attr(,"class") [1] "RspPageDirective" "RspDirective" "RspConstruct" "RspObject" [5] "character" RspPageDirective: page RspString: Content type: NA Language: NA Metadata to available. Number of characters: 9 Number of lines: 1 ############################################################################## <%@page%> [1] "paste" attr(,"class") [1] "RspPasteDirective" "RspDirective" "RspConstruct" [4] "RspObject" "character" RspPasteDirective: paste RspString: Content type: NA Language: NA Metadata to available. Number of characters: 10 Number of lines: 1 ############################################################################## <%@paste%> [1] "string" attr(,"class") [1] "RspStringDirective" "RspVariableDirective" "RspDirective" [4] "RspConstruct" "RspObject" "character" RspStringDirective: string RspString: Content type: NA Language: NA Metadata to available. Number of characters: 11 Number of lines: 1 ############################################################################## <%@string%> character(0) attr(,"class") [1] "RspText" "RspConstruct" "RspObject" "character" RspText: RspString: Content type: NA Language: NA Metadata to available. Number of characters: 0 Number of lines: 0 ############################################################################## [1] "unknown" attr(,"class") [1] "RspUnknownDirective" "RspDirective" "RspConstruct" [4] "RspObject" "character" RspUnknownDirective: unknown RspString: Content type: NA Language: NA Metadata to available. Number of characters: 12 Number of lines: 1 ############################################################################## <%@unknown%> [1] "unparsed" attr(,"class") [1] "RspUnparsedDirective" "RspDirective" "RspConstruct" [4] "RspObject" "character" RspUnparsedDirective: unparsed RspString: Content type: NA Language: NA Metadata to available. Number of characters: 0 Number of lines: 0 ############################################################################## character(0) attr(,"class") [1] "RspUnparsedExpression" "RspExpression" "RspConstruct" [4] "RspObject" "character" RspUnparsedExpression: [1] "variable" attr(,"class") [1] "RspVariableDirective" "RspDirective" "RspConstruct" [4] "RspObject" "character" RspVariableDirective: variable RspString: Content type: NA Language: NA Metadata to available. Number of characters: 13 Number of lines: 1 ############################################################################## <%@variable%> character(0) attr(,"class") [1] "RspVoid" "RspConstruct" "RspObject" "character" RspVoid: RspString: Content type: NA Language: NA Metadata to available. Number of characters: 0 Number of lines: 0 ############################################################################## > > d <- RspConstruct() > print(d) character(0) attr(,"class") [1] "RspConstruct" "RspObject" "character" RspConstruct: > > d <- RspComment() > print(d) character(0) attr(,"class") [1] "RspComment" "RspConstruct" "RspObject" "character" RspComment: > > d <- RspText() > print(d) character(0) attr(,"class") [1] "RspText" "RspConstruct" "RspObject" "character" RspText: > > d <- RspVoid() > print(d) character(0) attr(,"class") [1] "RspVoid" "RspConstruct" "RspObject" "character" RspVoid: > > d <- RspDirective() > print(d) character(0) attr(,"class") [1] "RspDirective" "RspConstruct" "RspObject" "character" RspDirective: > > d <- RspCopyDirective() > print(d) [1] "copy" attr(,"class") [1] "RspCopyDirective" "RspCutDirective" "RspDirective" "RspConstruct" [5] "RspObject" "character" RspCopyDirective: copy > > d <- RspEndcopyDirective() > print(d) [1] "endcopy" attr(,"class") [1] "RspEndcopyDirective" "RspEndcutDirective" "RspDirective" [4] "RspConstruct" "RspObject" "character" RspEndcopyDirective: endcopy > > d <- RspCutDirective() > print(d) [1] "cut" attr(,"class") [1] "RspCutDirective" "RspDirective" "RspConstruct" "RspObject" [5] "character" RspCutDirective: cut > > d <- RspEndcutDirective() > print(d) [1] "endcut" attr(,"class") [1] "RspEndcutDirective" "RspDirective" "RspConstruct" [4] "RspObject" "character" RspEndcutDirective: endcut > > d <- RspPasteDirective() > print(d) [1] "paste" attr(,"class") [1] "RspPasteDirective" "RspDirective" "RspConstruct" [4] "RspObject" "character" RspPasteDirective: paste > > d <- RspExpression() > print(d) character(0) attr(,"class") [1] "RspExpression" "RspConstruct" "RspObject" "character" RspExpression: > > d <- RspCode() > print(d) character(0) attr(,"class") [1] "RspCode" "RspExpression" "RspConstruct" "RspObject" [5] "character" attr(,"echo") [1] FALSE RspCode: > > d <- RspCodeChunk() > print(d) character(0) attr(,"class") [1] "RspCodeChunk" "RspCode" "RspExpression" "RspConstruct" [5] "RspObject" "character" attr(,"echo") [1] FALSE attr(,"return") [1] FALSE RspCodeChunk: > > proc.time() user system elapsed 0.57 0.10 0.68