Finally fixing the array/struct BIFs that return true

This will be in the release notes for our next beta, but I wanted to highlight a change we’ve made today that addresses the following BIFs, which return a boolean which makes chaining impossible and just isn’t very useful.

  • arrayAppend()
  • arrayClear()
  • arrayDeleteAt()
  • arrayInsertAt()
  • arrayResize()
  • arraySet()
  • arraySwap()
  • StructClear()
  • StructKeyTranslate()
  • StructInsert()
  • structAppend()
  • QuerySetRow()
  • QueryDeleteRow()
  • QuerySort()
  • ArrayPrepend()
  • arrayDelete()
  • structDelete()

In BoxLang source files, all of the BIFs above will return the data structure they modified!

Running legacy CF code on BoxLang? Not to worry. Our transpiler has been modified to detect if the return value of the BIF is actually being captured/used. If so, we’ll transpiler the code to an IIFE behind the scenes that returns true for all BIFs but the last two in the list. arrayDelete() and structDelete() can actually return true or false and that behavior will be preserved for CF source files being transpiled.

More info here on the ticket: [BL-357] - Welcome

3 Likes