Alternative to PUT value INTO variable

Something you want to see in a LiveCode product? Want a new forum set up for a specific topic? Talk about it here.

Moderator: Klaus

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3582
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Alternative to PUT value INTO variable

Post by mwieder »

Heh. How about "==="?
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Alternative to PUT value INTO variable

Post by FourthWorld »

mwieder wrote: Tue Sep 25, 2018 3:00 am Heh. How about "==="?
I'm on board if we can nest them like parentheses in LISP. ;)
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Alternative to PUT value INTO variable

Post by bogs »

Myself, I can't wait till we see them introduce this symbol ~
(<>.(<>.,<>)>.,<>)
Image
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Alternative to PUT value INTO variable

Post by FourthWorld »

bogs wrote: Tue Sep 25, 2018 6:12 pm Myself, I can't wait till we see them introduce this symbol ~
(<>.(<>.,<>)>.,<>)
Now you're talking. But maybe we can spice it up with required white space that changes the meaning of the statement if you change the placement of a space character, as folks enjoy with Python. ;)
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3582
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Alternative to PUT value INTO variable

Post by mwieder »

Yah, that's the one thing that bugs me about python programming. But a good IDE will enforce proper indentation to help keep you out of trouble.



... and don't forget ruby's spaceship operator (<=>). It's actually a very useful operator, and one that would help solve a lot of the numeric/string comparisons in LC.

Code: Select all

https://subvisual.co/blog/posts/90-ruby-bits-br-spaceship-operator/
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Alternative to PUT value INTO variable

Post by bogs »

mwieder wrote: Tue Sep 25, 2018 7:45 pm ruby's spaceship operator (<=>)
Don't forget the Conan operator ( cssssss{|;;;;;;;;;;;;;;;;;;;> ) which makes sushi out of your code in any language :D
Image
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Alternative to PUT value INTO variable

Post by bogs »

I was doodling around today and had to reset a number of variables manually to "". I was thinking how nice it would be in this one use-case to be able to do that just by writing something like ~

Code: Select all

put "" into (tmp1) and (tmp2) and (tmp3) and...

or even

Code: Select all

set the value of tmp1 and tmp2 and tmp3 to ""
<sigh> :mrgreen:
Image
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Alternative to PUT value INTO variable

Post by FourthWorld »

bogs wrote: Wed Jan 16, 2019 10:42 pm I was doodling around today and had to reset a number of variables manually to "". I was thinking how nice it would be in this one use-case to be able to do that just by writing something like ~

Code: Select all

put "" into (tmp1) and (tmp2) and (tmp3) and...

or even

Code: Select all

set the value of tmp1 and tmp2 and tmp3 to ""
<sigh> :mrgreen:
Such a large number of variables handled uniformly suggests a good case for an array, where emptying all of its slots is an even shorter one-liner.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Alternative to PUT value INTO variable

Post by bogs »

Yah, was already thinking along those lines, but good to have confirmation :D
Image
Post Reply