Commits

Ronny Pfannschmidt committed 8ea9df4

new stuff

  • Participants
  • Parent commits 637d8a2

Comments (0)

Files changed (2)

+
+:- op(100, yfy, prog).
+:- op(100, fx, [ class, get, set, def, new, property ]).
+
+:- op(1100, xf, ';').
+
+
+test prog {
+
+testing = class {
+    init = def (name) -> {
+        self->name = name;
+    };
+    name = property {
+        get {
+            self->name;
+        };
+    };
+};
+
+test = def {
+    o = new testing("test");
+    print(o->name);
+};
+
+}.
+
+printing prog {
+   print("hi");
+   print("yo");
+}.
+
+
+
+eval(print(X), Ctx, Ctx) :- write(X).
+
+eval( Cmd ; NS , Context, New) :- 
+    eval(Cmd, Context, Mid), eval(NS, Mid, New).
+eval( Cmd ; , Context, New) :- 
+    eval(Cmd, Context, New).
+
+eval(Prog) :- Prog prog { NS } , eval(NS, a, a ).
+:- eval(printing).
-:- op(1080, fx, select).
+:- op(1080, fx, [select, create]).
 :- op(1070, yfy, where).
 :- op(1060, yfy, from).
 :- op( 900, yfy, join).
-:- op( 850, yfy, on).
+:- op( 950, yfy, [as, of]).
+:- op( 850, yfy, [on, references]).
 :- op( 800, xfx, [or, and]).
 :- op( 100, yfy, like).
-:- dynamic (select)/1.
+:- op( 1000, fx, [table, index]).
 
+create table users as (
+    id of int,
+    name of string(30),
+    id is primary,
+    name is unique
+    ).
+
+create table user_permissions as (
+    user_id of int references users(id),
+    permission_id of int references permissions(id),
+    {user_id, permission_id} is primary
+    ).
 
 select
     users(id, name),
     users(id) = 1
     or users(name) like 'M?yer'.
 
+
+
+select now as time.
+select 1.
+
 :- (select X from Y where Z),
     write_canonical(X),nl,
     write_canonical(Y),nl,