Skip to content

Comment on Lisp implementation in sedparent

Comments

Or, if we're going to go with Prolog-inspired syntax, then why not Prolog?

    grade(Student, Grade) :-
        worked(Student, Work), work_grade(Work, Student, Grade).
    work_grade('Excellent', _, 'A+').
    work_grade('Okay', Student, 'B') :- tried_hard(Student).
    work_grade('Okay', _, 'B-').
    work_grade(_, _, 'C').
I'm a bit rusty, and I don't have a Prolog interpreter to hand to test, so I might have got some syntax wrong.
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.