• skip to sidebar
  • skip to search box

trainedmonkey

by Jim Winstead Jr.

Acomplish accomplished

I was perusing some old messages in the archives of the PHP mailing lists, and I stumbled across an email from me where I shared a sample of code as an example of a “natural” language I had used. That’s some real Acomplish code!

[ Declaration of a function to add an item to a list, keeping the list sorted. ]
To insert an item 'the_item' sorted into an item 'the_container':
    For each item 'the_place' in the_container,
        If the_item < the_place,
            Add the_item before the_place.
            Return.
    Append the_item to the_container.

Make a list named myList of { 2, 3, 7, 14}.
Insert 10 sorted into myList.
Print myList.
[ Prints 2, 3, 7, 10, 14, more or less. ]

And another historical bit of trivia in that email: I proposed a for ... in syntax for PHP, although that eventually became foreach ... as.

» Wednesday, May 29, 2024 @ 5:37pm » code, acomplish » Bluesky butterfly logo » Comment
« Exadelic • Embrace the dark »

Add a comment

Sorry, comments on this post are closed.

  • Home
  • About
  • Archive
  • Bookmarks
  • Photos
  • Projects
  • GitHub
  • @jimw@mefi.social

Dedicated to the public domain by Jim Winstead Jr.