Latest Tech News

Stay updated with the latest in technology, AI, cybersecurity, and more

Filtered by: function Clear Filter

Simplest C++ Callback, from SumatraPDF

SumatraPDF is a Windows GUI application for viewing PDF, ePub and comic books written in C++. A common need in GUI programs is a callback. E.g. when a button is clicked we need to call a function with some data identifying which button was clicked. Callback is therefore a combo of function and data and we need to call the function with data as an argument. In programming language lingo, code + data combo is called a closure. C++ has std::function<> and lambdas (i.e. closures). Lambdas convert

Writing a Truth Oracle in Lisp

This post assumes some familiarity with typed functional programming, Lisp, and formal logic. Today we will attempt to write a truth oracle in Lisp. By "truth oracle," I mean a program that can determine whether arbitrary mathematical statements are true or false. This might sound impossible, due to first-order logic being undecidable, but let's try anyway. Before that, though, we need to go over some required concepts. Extracting information from proofs First, sometimes, we can extract info