Page 1 of 1

SenseTalk features to LiveCode?

Posted: Wed Sep 14, 2016 6:20 am
by rinzwind
I think its a good thing to research the few other xTalk alternatives looking for ideas to improve LiveCode.

SenseTalk was the scripting environment of NeXTStep/OpenStep (you know, the one where mr Jobs was involved with) and now officially in use by TestPlant/eggPlant (automated testing platform). It has some very good documentation, both online and in PDF. I would recommend for the main architect(s) of the LiveCode language to take a good look at their additions to HyperCard and give them complements by implementing some of these additions in LiveCode.

Some things seems to be easy to implement and are a major improvement. Things that also are already frequently requested by other LC users. Things like multi line value assignment (text block) and by reference variables.

PDF: http://docs.testplant.com/PDFs/SenseTal ... erence.pdf

The database handling is also neat (implemented as a language feature).

simple values
<3FA64B> --binary, spaces, newline ignored

text block
put {{The Matrix
Terminator
Star Trek}} into movies

nested list

property list
put (name:"john", age:30) into person
put name of person
put person.name

iterator
put "A" to "Z" into alphabet
put alphabet.nextValue
OR
...


byte size
MB KB

local, global (main stack), universal (between main stacks)

multi variable assignment
put 0 into (a, b, c)
put 1, 2, 3 into a, b, c

put 30 into age
put reference to age into age2
OR
put @age into age2
put age2
add 1 to age2
put age --31
add 1 to age
put age2 --32

myFunction @age --pass reference to age to myFunction

automatic date/time/weight/size arithmetic/conversion
put today + 2 weeks into dueDate

more date formats (international date)

database handling

Re: SenseTalk features to LiveCode?

Posted: Thu Sep 15, 2016 5:43 am
by rinzwind
It supports the DOT NOTATION which is clean and short ;)
:
put (firstName:"Joseph", age:50) into joe put property age of joe -- 50
put the age of joe -- 50
put joe's firstName -- Joseph
put joe.firstName -- Joseph

tellMeMore's elucidation "terse",5
utilities.insertCommas @myNumber,3

Object first notation also makes it possible to create a more useful intellisense code editor feature.

Re: SenseTalk features to LiveCode?

Posted: Sat Sep 17, 2016 2:56 am
by capellan
How did work for Macromedia Director mixing dot syntax and
their own x-talk influenced Lingo language?

https://en.wikipedia.org/wiki/Lingo_(pr ... _language)
http://help.adobe.com/en_US/Director/11 ... -7fce.html

Re: SenseTalk features to LiveCode?

Posted: Fri Nov 04, 2016 4:13 pm
by rinzwind
Interesting (old) interview with the main architect of SenseTalk/HyperSense Doug Simons. Shame its only used in eggPlant...
http://www.zathras.de/angelweb/xtalkint ... simons.htm

The same questions asked to other xTalk people out there.

Re: SenseTalk features to LiveCode?

Posted: Fri Nov 04, 2016 5:30 pm
by FourthWorld
rinzwind wrote:text block
put {{The Matrix
Terminator
Star Trek}} into movies
I submitted a similar request some time ago, inspired at the time by bash's heredoc. I just updated that with consideration of the SenseTalk syntax (thanks for drawing my attention to that - heredoc is arguably geekier than would be best for our language, and having another xTalk already provide this provides useful guidance):
http://quality.livecode.com/show_bug.cgi?id=17471

Re: SenseTalk features to LiveCode?

Posted: Fri Nov 04, 2016 8:52 pm
by mwieder
Nice suggestions.
myFunction @age --pass reference to age to myFunction
I believe this is now done be default behind the scenes without needing to explicitly state it.
Since LC8 (IIRC) LiveCode has supported copy-on-write, so no extra copy is created until it's necessary.

However, in the sense of passing a handle to an asset, that's still handled at the function definition end rather than at the caller end.
I can't say one way is better than the other, but trying to manage both optionally would be a nightmare for the parser.