News for hackers. Stuff that matters.
Re:Racket is 25 by junke on Sunday May 10, 2020 @12:55PM (#23134086)
What is magical apart from pattern matching is how you can invocate it with mixed ground terms and variables, and it computes values that makes the relationship holds. For example:

    [eclipse 2]: concat(A,[_,_],[0,1,2,3,4]).

    A = [0, 1, 2]
    Yes (0.00s cpu, solution 1, maybe more) ? ;

    No (0.00s cpu)
Or iterate over all lists that concatenate as [0,1,2]

    [eclipse 3]: concat(A,B,[0,1,2]).
    
    A = []
    B = [0, 1, 2]
    Yes (0.00s cpu, solution 1, maybe more) ? ;
    
    A = [0]
    B = [1, 2]
    Yes (0.00s cpu, solution 2, maybe more) ? ;
    
    A = [0, 1]
    B = [2]
    Yes (0.00s cpu, solution 3, maybe more) ? ;
    
    A = [0, 1, 2]
    B = []
    Yes (0.00s cpu, solution 4)

There are no comments on this comment yet.