Comments (2)
Just to clarify what you mean, you would like to be able to have something like:
public class Map
{
public function set(key:*, value:*) : void
{
// stuff
}
}
I think the compiler might be challenged to differentiate that from:
public class Map
{
public function set myval(key:*, value:*) : void
{
// stuff
}
}
which is a property setter..
Is there any reason you couldn't use capitalised versions or something to differentiate it from the reserved words? I'd be a little hesitant about changing those kinds of things..
thanks
from adobe-runtime-support.
Yes, that's exactly what I mean. I'm also want to use some other reserved keywords like break
, continue
, default
...
The reason is, in some case I think they're the best names to use.
In above example, I just want my classes (Map/Set) to have same API compared to JavaScript, so anyone that familiar with javascript can use my lib right away.
Set.delete()
Map.delete()
Map.get()
Map.set()
Another example, I have a class AsyncLoop
that can construct something like for loop. It can handle multiple items need to be loaded/processed asynchronously. And I need some functions called break
, continue
to break/continue the async loops.
I'm also building some library that use command line processes. The command line APIs have flags/switches named include
, default
... And I want to use them as property names.
In some programing languages, there're ways to use reserved names. For example in C# I can use the @
prefix.
Back to your example, I think it's quite easy to distinguish:
public class Map
{
public function set(key:*, value:*) : void
{
// if there's nothing after set, so set is the function name
}
}
public class Map
{
public function set myval(key:*, value:*) : void
{
// there's something after set (myval), so set is a keyword
}
}
from adobe-runtime-support.
Related Issues (20)
- [Feature Request] `NativeProcess` sync execution
- android:id/content/FrameLayout[1]/AIRWindowSurfaceView[1]
- On Android - Dropdown on StageWebView doesn't work
- unknown configuration variable 'compiler.float' HOT 10
- [IOS] Package issue HOT 4
- [Linux] No sound under sudo
- [Linux] No sound under sudo after `AudioDeviceManager.audioDeviceManager.deviceNames` call HOT 2
- [Linux] Empty `AudioDeviceManager.audioDeviceManager.deviceNames` under sudo
- iOS App Crashing on launch HOT 5
- Crash on Amazon device with AIR 5.1.1.1 and beyond HOT 2
- [AIR 51.1.1.4][Windows] `EncryptedLocalStore.reset()` cause internal error HOT 1
- App crash on all android test devices HOT 3
- PrintJob : add two-sided (duplex) printing and select printer paper tray
- [Linux] `TimeZone` return `rawOffset` in seconds, not milliseconds HOT 1
- Wrong debug line HOT 4
- [Windows] `TimeZone` return `rawOffset` and `daylightSavingsOffset` with incorrect sign HOT 4
- [Linux] `TimeZone::daylightSavingsOffset==0` if `TimeZone::usesDaylightSavings==false` HOT 1
- function.declaration enhancement
- [Android] Updated Android Studio, can no longer run on mobile device (Gradle.. but what?) [/`Unable to run java: com.adobe.air.ADTException: gradle tool failed`] HOT 4
- App crashes on Ipad
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adobe-runtime-support.