Colorizing method and handler names

(Luc Naets) #1

Hey Mark,

Why is it that a method that is using the given clause doesn’t get recognized to be colorized in the same way as a method with round brackets?

I’m I missing something?

(Shane Stanley) #2

You’re not missing anything – it’s simply not designed to work with handlers that use labelled syntax.

(Ed Stockly) #3

this is an Applscript compiler issue, not an Script Debugger problem, right?

(Shane Stanley) #4

I took it to be a reference to Script Debugger’s Apply color to method and handler names feature.

(Ed Stockly) #5

Got it, thanks! That explains it.

(Luc Naets) #6

Can it be solved in the next version then?

(Shane Stanley) #7

It can certainly be added to the wish-list.

I must say, I didn’t think many people bothered with that form of labelled syntax any more…

(Luc Naets) #8

Hey Shane,
It makes your code so readable…
How do you do it then? with round brackets?

or you can use it the following way:

doMethod({theID:mID, theName:mName})

on doMethod(par)
set mID to par’s theID
set mName to par’s theName

– do something with it

(Shane Stanley) #9

For readability, I prefer interleaved terminology:

my doMethodID:mID andName:mName

on doMethodID:theID andName:theName