Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

30
LINES

< > BotCompany Repo | #1033988 // test_leftArrowScript

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (21971L/133K).

svoid test_leftArrowScript() {
  testFunctionValues(script -> leftArrowVerbose((S) script),
    // int primitive
    
    [[ 5 ]], 5,
    [[ -5 ]], -5,
    
    // function definition & call
    [[
      def double x {
        Math multiplyExact x 2
      }
      
      double 10
    ]], 20,
  
    // new object with constructor arguments
    [[ new Pair "hello" "world" ]], pair("hello", "world"),
    
    // double primitive
    [[ str 1.5e2 ]], "150.0",
    
    // [not implemented, too complicated]
    // last = result of last statement
    // [[ plus 1 2; Math addExact 5 last ]], 8,
    
    // get static field
    [[ Color black ]], Color.black,
  );
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033988
Snippet name: test_leftArrowScript
Eternal ID of this version: #1033988/13
Text MD5: da4a7c49f3d64e421cc4a1571cdaefe7
Transpilation MD5: 9216684b4938048a4ad5330281fa6712
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-27 14:36:42
Source code size: 694 bytes / 30 lines
Pitched / IR pitched: No / No
Views / Downloads: 39 / 170
Version history: 12 change(s)
Referenced in: [show references]