Question that's been rattling around my head for good while

Please post general questions about MainLobby here
fcwilt
Member
Member
Posts: 97
Joined: Sat Sep 29, 2007 11:07 am
Location: Smith Mountain Lake, Virginia
Contact:

Question that's been rattling around my head for good while

Postby fcwilt » Wed Mar 05, 2014 11:16 pm

Hi,

One thing that I have always wondered about.

Consider a language like C.

If I write something like

abc = 123;

abc refers to a variable. Since variables names cannot being with a numeric character we know 123 is a numeric constant.

If I write something like

abc = def;

we know that both are variables.

If I want to assign, say, a character constant to a char variable I write

xyz = 'm'

In other words simple groups for letters (abc, def, xyz) refer to variables not character or string constants.

The other languages I have worked seem to follow this pattern.

ML seems to have chosen the reverse so to speak. We have to surround the simple groups of letters with {{ and }} to tell ML that they are variables as opposed to surrounding them with, say, quotes, to tell ML they NOT variables but strings.

This has always struck me as rather strange and makes things somewhat hard to read as there are often many {{ and }} here and there.

How did this come about?

Thanks!
Regards, Frederick C. Wilt

User avatar
CinemarDave
Site Admin
Site Admin
Posts: 10535
Joined: Fri Feb 07, 2003 8:56 am
Location: Planet Earth
Contact:

Re: Question that's been rattling around my head for good wh

Postby CinemarDave » Thu Mar 06, 2014 11:30 am

The short answer was that back in the day when MainLobby was just a Flash client we had to come up with syntax that would not break the embedded actionscript in the client. So that's really how it all evolved. The {{ }} and ~ and | were letters that did not confuse Flash so we used them. Then it became the norm going forward.

User avatar
Oronomus
Intermediate
Intermediate
Posts: 346
Joined: Mon Aug 14, 2006 1:18 pm
Location: Atlanta
Contact:

Re: Question that's been rattling around my head for good wh

Postby Oronomus » Thu Mar 06, 2014 11:45 am

I agree that its especially hard to read the conditional statements, something like this:

Conditional|IsNE##{{av_{{av_activedenon_{{clientname}}}}_input}}##{{av_activedenoninput_{{clientname}}}}##AV|{{av_activedenon_{{clientname}}}}~Input~{{av_activedenonzone_{{clientname}}}}~{{av_activedenoninput_{{clientname}}}}!

This basically says that if the current Denon input is not the same as (NE) the specified variable, then change the Denon input to the variable; otherwise leave it as is. Very hard to eyeball this to make sure it is correct. Usually find I must test a conditional command before including it in a button. Can live with this but wonder if there is a better way.

fcwilt
Member
Member
Posts: 97
Joined: Sat Sep 29, 2007 11:07 am
Location: Smith Mountain Lake, Virginia
Contact:

Re: Question that's been rattling around my head for good wh

Postby fcwilt » Thu Mar 06, 2014 11:53 am

CinemarDave wrote:The short answer was that back in the day when MainLobby was just a Flash client we had to come up with syntax that would not break the embedded actionscript in the client. So that's really how it all evolved. The {{ }} and ~ and | were letters that did not confuse Flash so we used them. Then it became the norm going forward.


Thanks for the reply - that clears things up.

Perhaps, just perhaps (and I would be in favor of this) now that you are going forward with HTML based clients (big improvement by the way) it might be time to make the change (clearly not backwards compatible) to a cleaner syntax.

Perhaps a polling of existing customers?

A more common "dotted" syntax would be (IMO) much easier to read: abc.def.xyz versus {{abc}}{{def}}{{xyz}} - and that's just with three letter names.

Good - got that off my chest - feel better now.

Thanks!
Regards, Frederick C. Wilt


Return to “MainLobby Questions & Answers”

Who is online

Users browsing this forum: No registered users and 1 guest