<commit_before>================================================================
Logtalk - Open source object-oriented logic programming language
Release 2.38.0

Copyright (c) 1998-2009 <NAME>.        All Rights Reserved.
Logtalk is free software.  You can redistribute it and/or modify
it under the terms of the "Artistic License 2.0" as published by 
The Perl Foundation. Consult the "LICENSE.txt" file for details.
================================================================


% start by loading the example:

| ?- logtalk_load(lambdas(loader)).
...


% some sample queries using the "metapredicates" library predicates:

| ?- meta::map(\X^(X>3),[4,5,9]).
yes

| ?- meta::map(t+\X^Y^(X=A-B,Y=B-A), [1-a,2-b,3-c], Zs).
Zs = [a-1,b-2,c-3]
yes

| ?- meta::map(\X^Y^(X=A-B,Y=B-A), [1-a,2-b,3-c], Zs).
Zs = [a-1,b-2,c-3]
yes

| ?- meta::map(\X^(B-A)^(X=A-B), [1-a,2-b,3-c], Zs).
Zs = [a-1,b-2,c-3]
yes

| ?- meta::map(\ (A-B)^(B-A)^true, [1-a,2-b,3-c], Zs).
Zs = [a-1,b-2,c-3]
yes

| ?- Xsss = [[[1,2,3],[4]],[[5]]], meta::map(meta::map(meta::map(\X^Y^(Y is X+3))), Xsss,  Ysss).

Xsss = [[[1,2,3],[4]],[[5]]]
Ysss = [[[4,5,6],[7]],[[8]]]
yes

<commit_msg>Updated the experimental implementation of lambda expressions.<commit_after>================================================================
Logtalk - Open source object-oriented logic programming language
Release 2.38.0

Copyright (c) 1998-2009 <NAME>.        All Rights Reserved.
Logtalk is free software.  You can redistribute it and/or modify
it under the terms of the "Artistic License 2.0" as published by 
The Perl Foundation. Consult the "LICENSE.txt" file for details.
================================================================


% start by loading the example:

| ?- logtalk_load(lambdas(loader)).
...


% some sample queries using the "metapredicates" library predicates:

| ?- meta::map(\X^(X>3),[4,5,9]).
yes

| ?- meta::map(t+\X^Y^(X=A-B,Y=B-A), [1-a,2-b,3-c], Zs).
Zs = [a-1,b-2,c-3]
yes

| ?- meta::map(\X^Y^(X=A-B,Y=B-A), [1-a,2-b,3-c], Zs).
Zs = [a-1,b-2,c-3]
yes

| ?- meta::map(\X^(B-A)^(X=A-B), [1-a,2-b,3-c], Zs).
Zs = [a-1,b-2,c-3]
yes

| ?- meta::map(\ (A-B)^(B-A)^true, [1-a,2-b,3-c], Zs).
Zs = [a-1,b-2,c-3]
yes

| ?- Xsss = [[[1,2,3],[4]],[[5]]], meta::map(meta::map(meta::map(\X^Y^(Y is X+3))), Xsss,  Ysss).
Xsss = [[[1,2,3],[4]],[[5]]]
Ysss = [[[4,5,6],[7]],[[8]]]
yes

| ?- meta::map((\X^[X]^true),[1,2],Ys).       
Ys = [[1],[2]]
yes

| ?- meta::map((\X^[X]^true),Xs,[[1],[2]]).    
Xs = [1,2] ? 
yes


{'fraction_non_alphanumeric': 0.3458767013610889, 'fraction_numerical': 0.049639711769415534, 'mean_word_length': 4.20625, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6785694', 'n_tokens_mistral': 1141, 'n_tokens_neox': 1079, 'n_words': 216}