Skip to content

Instantly share code, notes, and snippets.

View pmcgee69's full-sized avatar

Paul McGee pmcgee69

  • Perth, Western Australia
View GitHub Profile
@pmcgee69
pmcgee69 / Haskell_tree.dpr
Last active November 11, 2024 14:23
Delphi equivalent of Haskell Tree
{$APPTYPE CONSOLE}
program haskell_tree_4;
type
PMyTree = ^MyTree;
MyTree = record
case b:boolean of
false : ( );
true : ( Node : integer;
Left, Right : PMyTree );
@pmcgee69
pmcgee69 / Rust_familiar.rs
Last active October 9, 2024 20:12
Rust examples that are familiar to Object Pascal programmers
// Source: Hands-on Rust.
use​ ​std​::​io​::stdin;
fn​ ​main() {
letMYLIST = [ ​"One"​, ​"Two"​, ​"Three"​ ];
​  ​for​ i in 0..3 {
​  println!(​"{}"​, MYLIST[i]);
​  }
}
@pmcgee69
pmcgee69 / Multi_Case.dpr
Last active May 14, 2024 16:03
Sergey Antonov - 2010 - Blog post : Just Any type Delphi Case statement
{$APPTYPE CONSOLE}
program Multi_Case;
// Also see - http://delphi.fosdal.com/2010/12/generic-case-for-strings.html
// - http://delphi.fosdal.com/2010/12/generic-cache.html
uses system.SysUtils, system.Generics.Defaults;
// Just Any type Delphi Case statement (2010)
// Sergey Antonov Blog
@pmcgee69
pmcgee69 / Ref_basics.dpr
Created May 14, 2024 08:00
Testing some pointer basics
{$APPTYPE CONSOLE}
program Nulls_in_Delphi;
uses
System.SysUtils;
const nl = sLineBreak;
procedure print(a:pointer;b:longint; s:string);
begin
writeln( longint(a).ToHexString, ' ', b.ToHexString, ' ', s);
@pmcgee69
pmcgee69 / Simplified Auto Ref Counting.txt
Created August 3, 2023 15:59 — forked from Pasquina/Simplified Auto Ref Counting.txt
A Delphi Console Application to illustrate Automatic Reference Counting (Simplified)
program AutoFreeTest;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,
System.Classes;
type
IAutoFree = interface
@pmcgee69
pmcgee69 / delphi_blogs.md
Last active February 27, 2023 14:31
Delphi blogs

"Jarrod Hollingworth" "Colin Johnsun" "Graham Ritchie" "Ian Krigsman" "James D Duff" "Kim Bracknell" "Mathias Burbach" "Misha Charrett" "Niels Maschmeyer" "Paul Jervois"

@pmcgee69
pmcgee69 / repos.md
Last active February 27, 2023 14:26
Delphi repos located away from Github

Keybase proof

I hereby claim:

  • I am pmcgee69 on github.
  • I am paulmcgee (https://keybase.io/paulmcgee) on keybase.
  • I have a public key whose fingerprint is 8DD8 B479 B84A 1A98 2477 F21B A694 C45B C584 7FFE

To claim this, I am signing this object:

@pmcgee69
pmcgee69 / ReaderScript.hs
Last active April 19, 2021 21:21
Exploring the Reader functor
-- Reader / unReader syntax
newtype Reader e a = Reader { unReader :: e -> a }
:t Reader
:t unReader