I love xTalk. While I have written code in many dozens of languages over my career, I personally will likely never code in anything other than xTalk for as long as I continue to write code.

That said, one of the "problems" of a programming language that is so intuitive is that I sometime write code that I expect to work ... and it doesn't. The container sort with params was one such instance.

Perhaps it is a compliment to Livecode/LCS that I EXPECTED it to work and was SURPRISED when it did not :-)

On 3/3/2021 1:00 PM, Richard Gaskin via use-livecode wrote:
Paul Dupuis wrote:

> I just discovered much to my dismay that you can not execute the
> following:
> put "ascending" into tDirection
> soft lines of tContainer tDirection international
> apparently neither the sort direction (ascending|descending) nor the
> sort type (international|text|datetime|numeric|binary) can be
> variable!
> I see this a a bug or perhaps a failure to fully robust impliment the
> sort container command? Does any one else see this as a bug?

Bug or feature?  The ambiguities introduced by the HyperTalk team have made that an evergreen question. ;)

Some tokens can be parameterized, others not.

MC/LC goes much further than HC in allowing object references to be a mix of literal and variable expressions, e.g.:

   -- Works in LC, not in HC:
   put the long id of this cd into tCdObj
   get the name of btn 1 of tCdObj

...but other expressions and keywords are not so clear.

Let's see what happens if we parameterize everything in your statement:

  put "ascending" into tDirection
  put "numeric" into tSortType
  put "items" into tChunkType
  put "1,2,3,4,5,6,7,8,9" into tData
  sort tChunkType of tData tSortType tDirection

In that last line, which variables should we expect to be allowed, and which ones not?

I'm certain there's a rule defining this.

I'm equally certain I've never met any xTalker who was able to intuit that rule with complete confidence.

use-livecode mailing list
Please visit this url to subscribe, unsubscribe and manage your subscription 

Reply via email to