File lists - function or command?

David Bovill david at openpartnership.net
Sat Jan 6 11:41:35 EST 2007


Richard I do not recall that thread but my take on this is that the
differences fall into:

  1) Functional - now whats a better word for this :)

The functional distinction is AFAIK almost zero. There is only one possible
functional issue that I came across a few years back - which may have
changed and remains "unconfirmed". That is with "sending" messages. While
you can "send" both "functions" and "commands" - I found a situation where
somewhere down the chain "sending" of a function became problematic. It may
have been an issue with arrays - either way I switched to "commands" in
situations where I need to "send" complex data around and cutom properties
where I can use more simple data structures.Mainly for stylistic reasons
(see below).

  2) Stylistic

The only other place I use commands where it is otherwise more natural to
use a function to return a result is if I want many results and use
pass-by-reference variables to return these.

With the functions I uses for waliking directories of stack for that matter
- I have one complex "command" that returns multiple variables - ie file
name, file type and a simpler function that calls the "command" - but this
could equally be done as a "functin" with call-by-reference params - just
which one do you return + you loose the benefit of auto-completion filling
in that param types.



More information about the use-livecode mailing list