Comments (8)
The problem of visibility was discussed in length in ceylon/ceylon-spec#56 . There was a suggestion to make non-shared members visible to other code in the same compilation unit. In this case that would allow us to write toplevel functions (like createWhole(String)
) that can access the non-shared members of the class as long as they are defined in the same file. Gavin actually wanted to consider this feature for M2 but looks like that didn't happen.
from ceylon-sdk.
I don't think the discussion in ceylon/ceylon-spec#56 fully addresses what I'm trying to do. I want to wrap a BigInteger
or BigDecimal
, in a Whole
/Decimal
but I don't want to declare it as a variable
attribute because there's no need for it to be. This means I have to pass it to the initializer. But I can't hide the initializer without hiding the class itself. And making the type non-shared
defeats the whole point!
I suppose I could use a shared abstract class with a nullary initializer and a non-shared
implementation. But having two classes to achieve something as simple as this seems silly.
from ceylon-sdk.
@tombentley triage?
from ceylon-sdk.
Well, quoted literals are dead in the water at this point; I worked around the lack of literal support using the parse functions. The problem of initializers having the same visibility as the class is a known language issue. So at this point there's nothing to do about this issue. If we're happy with the currently solution, and the language isn't going to offer alternative solutions in the foreseeable future we could close it, I guess.
from ceylon-sdk.
FTR, my proposal to allow you to define a class that can't be extended outside of the module in which it is defined sorta kinda gives you a "private" constructor: just declare the class abstract
, and then the only "constructors" for it are subclasses within the same module...
from ceylon-sdk.
But then it's another class.
We're coming back to the issue of multiple constructors, and the issues with implementing clone
. I still think we don't have a good answer to those problems. As much as I will never miss overloading for methods, we haven't found a replacement for overloading constructors.
from ceylon-sdk.
Moving to M6.
from ceylon-sdk.
I think this is way out of date. We have parseXxxx()
methods, and Whole
/Decimal
are interfaces. Closing, unless @tombentley objects.
from ceylon-sdk.
Related Issues (20)
- http.server.Request.read() and "unterminated" strings HOT 1
- Ceylon logging should support loggers with class name HOT 1
- JavaList should throw IOOBE for bad indexes HOT 2
- change pattern for attributes in `ceylon.html` HOT 4
- Regex stickiness
- ceylon.test::parameters is unintuitive when test is wrapped in a class HOT 1
- ceylon.test::parameters is unintuitive when test is wrapped in a class
- make JavaMap, JavaSet, JavaList serializable
- JDK 9 adds SSLEngineResult.HandshakeStatus.NEED_UNWRAP_AGAIN
- Loading files from the classpath throws FileSystemNotFoundException
- Bad class file error using ceylon.file 1.3.4-SNAPSHOT
- ceylon.time.iso8601::parseDayOfMonth and parseDate fail for leap day HOT 5
- ceylon.time.Period compare and equals incompatible HOT 2
- ceylon.time.Period should be `Invertible` HOT 4
- Decimal == AnythingElse causes assertion failure HOT 3
- use 'new' enum style instead of old 'object' style HOT 3
- ceylon.time.Duration should satisfy Summable, Invertible, and Comparable
- assertThateException -> ExceptionAssert can't handle member exception classes
- promlem with parsing february 29 in leap year HOT 2
- ceylon test -F fails with AssertionError
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 ceylon-sdk.