changeset 2:f176dbb8a43c

add code folder
author e165727 <e165727@ie.u-ryukyu.ac.jp>
date Fri, 17 Jan 2020 00:49:28 +0900
parents c69958482abf
children 32bba57ef41c
files Paper/.DS_Store Paper/code/abyss.p6 Paper/code/client.p6 Paper/code/eval.p6
diffstat 4 files changed, 25 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
Binary file Paper/.DS_Store has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Paper/code/abyss.p6	Fri Jan 17 00:49:28 2020 +0900
@@ -0,0 +1,17 @@
+unit class Abyss::Server:ver<0.0.1>;
+use MONKEY-SEE-NO-EVAL;
+
+method readeval {
+  my $listen = IO::Socket::INET.new( 
+    :listen,
+    :localhost<localhost>,
+    :localport(3333) 
+    );
+  loop {
+    my $conn = $listen.accept;
+    while my $buf = $conn.read(1024) {
+      EVALFILE $buf.decode;
+    }
+    $conn.close;
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Paper/code/client.p6	Fri Jan 17 00:49:28 2020 +0900
@@ -0,0 +1,5 @@
+my $conn = IO::Socket::INET.new( :host<localhost>,
+                                 :port(3333) );
+
+$conn.print: 'FILEPASS';
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Paper/code/eval.p6	Fri Jan 17 00:49:28 2020 +0900
@@ -0,0 +1,3 @@
+use MONKEY-SEE-NO-EVAL; 
+ 
+EVAL "say { 5 + 5 }";   # OUTPUT: 10