{"id":16086911,"url":"https://github.com/olekscode/blockclosurelogicaloperations","last_synced_at":"2026-01-17T03:46:52.755Z","repository":{"id":88081260,"uuid":"256622713","full_name":"olekscode/BlockClosureLogicalOperations","owner":"olekscode","description":"Extension of Pharo's BlockClosure with basic operations of Boolean algebra","archived":false,"fork":false,"pushed_at":"2020-04-18T00:18:00.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T14:43:54.503Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Smalltalk","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/olekscode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-17T22:28:47.000Z","updated_at":"2020-04-18T00:45:13.000Z","dependencies_parsed_at":"2023-05-18T05:00:28.443Z","dependency_job_id":null,"html_url":"https://github.com/olekscode/BlockClosureLogicalOperations","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/olekscode/BlockClosureLogicalOperations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olekscode%2FBlockClosureLogicalOperations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olekscode%2FBlockClosureLogicalOperations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olekscode%2FBlockClosureLogicalOperations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olekscode%2FBlockClosureLogicalOperations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olekscode","download_url":"https://codeload.github.com/olekscode/BlockClosureLogicalOperations/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olekscode%2FBlockClosureLogicalOperations/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28493674,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T02:39:23.645Z","status":"ssl_error","status_checked_at":"2026-01-17T02:34:19.649Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-09T13:26:04.893Z","updated_at":"2026-01-17T03:46:52.733Z","avatar_url":"https://github.com/olekscode.png","language":"Smalltalk","readme":"# Logical Operations on Block Closures\n\n[![Build Status](https://travis-ci.org/olekscode/BlockClosureLogicalOperations.svg?branch=master)](https://travis-ci.org/olekscode/BlockClosureLogicalOperations)\n[![Build status](https://ci.appveyor.com/api/projects/status/6yqunglsbmsp18a1?svg=true)](https://ci.appveyor.com/project/olekscode/blockclosurelogicaloperations)\n[![Coverage Status](https://coveralls.io/repos/github/olekscode/BlockClosureLogicalOperations/badge.svg?branch=master)](https://coveralls.io/github/olekscode/BlockClosureLogicalOperations?branch=master)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/olekscode/BlockClosureLogicalOperations/master/LICENSE)\n\nThis repository contains a simple extension of Pharo's `BlockClosure` with basic operations of Boolean algebra. It allows us to decompose complex logical queries into meaningful parts that can be reused.\n\n## How to install it?\n\nTo install `BlockClosureLogicalOperations`, go to the Playground (Ctrl+OW) in your [Pharo](https://pharo.org/) image and execute the following Metacello script (select it and press Do-it button or Ctrl+D):\n\n```Smalltalk\nMetacello new\n  baseline: 'BlockClosureLogicalOperations';\n  repository: 'github://olekscode/BlockClosureLogicalOperations/src';\n  load.\n```\n\n## How to depend on it?\n\nIf you want to add a dependency on `BlockClosureLogicalOperations` to your project, include the following lines into your baseline method:\n\n```Smalltalk\nspec\n  baseline: 'BlockClosureLogicalOperations'\n  with: [ spec repository: 'github://olekscode/BlockClosureLogicalOperations/src' ].\n```\n\nIf you are new to baselines and Metacello, check out the [Baselines](https://github.com/pharo-open-documentation/pharo-wiki/blob/master/General/Baselines.md) tutorial on Pharo Wiki.\n\n## How to use it?\n\nLet's define several logical blocks closures:\n\n```Smalltalk\nisPositive := [ :x | x \u003e 0 ].\nisOdd := [ :x | x % 2 = 1 ].\n\nisTestClass := [ :aClass | aClass inheritsFrom: TestCase ].\nisEmptyClass := [ :aClass | aClass methods isEmpty ].\n```\nThey evaluate to Boolean values:\n\n```Smalltalk\nisOdd value: 2. \"false\"\nisTestClass value: ConditionTest. \"true\"\n```\n\nWe can manipulate and combine those blocks using all basic operations of boolean algebra: AND, OR, NOT, XOR, IMPLIES, and EQUALS:\n\n```Smalltalk\nisPositiveOrOdd := isPositive or: isOdd.\nisEmptyTestClass := isTestClass and: isEmptyClass.\n\nalwaysTrue := (isOdd not or: isPositive) logicalEquals: (isOdd implies: isPositive).\n```\n\nAny combination of logical block closures is also a logical block closure:\n\n```Smalltalk\nisEmptyTestClass value: ConditionTest. \"false\"\nisPositiveOrOdd value: -1. \"true\".\nalwaysTrue value: (Random new next). \"true\"\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folekscode%2Fblockclosurelogicaloperations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folekscode%2Fblockclosurelogicaloperations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folekscode%2Fblockclosurelogicaloperations/lists"}