ceylon

The Ceylon Typechecker: How to obtain the typed syntax tree?

爷,独闯天下 提交于 2019-12-22 08:27:49
问题 Im trying to programmatically use / embed the Ceylon Typechecker to analyse Ceylon source code. In this use case I want to access all the information that normally the compiler would consume. But Im not going to compile and Im not going to add dependency on the compiler. It seem to me that the main.Main entry point in ceylon/typechecker/src/main/Main.java is not the appropriate entry point for this use case (obtaining the typed tree and the attached models), because this information, which

Iterate enumerated class instances

夙愿已清 提交于 2019-12-20 02:12:51
问题 Is there a simple way to iterate over all enumerated instances of a class in Ceylon? Just like values() for Java enums? abstract class Suit() of hearts | diamonds | clubs | spades { shared formal String name; } object spades extends Suit() { name => "Spades"; } object clubs extends Suit() { name => "Clubs"; } object diamonds extends Suit() { name => "Diamonds"; } object hearts extends Suit() { name => "Hearts"; } Lets say I'd like to pick a random suit or I'd like to print all suits by their

The ceylon copy tool

流过昼夜 提交于 2019-12-12 23:19:17
问题 I'm using the ceylon copy command of ceylon version 1.2.3 to download a dependency: ./bin/ceylon copy --rep "http://repo.maven.apache.org/maven2/" -out outdir "joda-time:joda-time/2.9.4" Why is the result that the tools skips downloading it? Module joda-time:joda-time/2.9.4 [1/1]) Skipped. The tool looks - among others - for: http://repo.maven.apache.org/maven2//joda-time:joda-time/2.9.4/joda-time:joda-time-2.9.4.jar ... but it should look for: http://repo.maven.apache.org/maven2/joda-time

Cryptographic hashing in Ceylon

£可爱£侵袭症+ 提交于 2019-12-11 08:02:02
问题 What is the recommended way to import the standard cryptographic hashing (message digest) libraries (MD5, SHA1, SHA2, SHA256, SHA3, etc.) in Ceylon? 回答1: There doesn't seem to be a cryptography module in the SDK. There is Ceylon Crypto on Github (and as 3 separate modules in Herd), but it says in the README: Note that IANAC (I am not a cryptologist), so this will surely be flawed in some security relevant way. Do not use in production and don't rely on it in any expensive way whatsoever! If

Compiling code from within IntelliJ

不打扰是莪最后的温柔 提交于 2019-12-11 04:43:42
问题 I've managed to compile and execute Cyelon code in the 'Walkthrough' repository, by right clicking a function and choosing 'Run functionName'. I've also tried creating my own Ceylon-project (named POSTtoFile) and seeing if I could execute a 'Hello World' function from there. I couldn't. I guess I have to create some sort of build configuration for my project, but I don't know what to fill into these form fields: The Installing Ceylon IDE for IntelliJ guide is completely silent on this

Recursive aliases in Ceylon

折月煮酒 提交于 2019-12-11 03:07:14
问题 I am new to Ceylon, and am currently exploring how to port some existing software written in TypeScript (essentially JavaScript) to Ceylon, so that it can run both on JavaScript engines and JVM. Does anybody know how to code an equivalent of this Java stuff in Ceylon: public class Engine { ... } // Some given class definition public interface Cont extends Callable1<Cont,Engine> {} where Callable1<Y,X> is a Java equivalent of Ceylon's Callable<Y,[X]> . The idea is that an instance of Cont ,

The Ceylon Typechecker: How to obtain the typed syntax tree?

混江龙づ霸主 提交于 2019-12-05 13:48:23
Im trying to programmatically use / embed the Ceylon Typechecker to analyse Ceylon source code. In this use case I want to access all the information that normally the compiler would consume. But Im not going to compile and Im not going to add dependency on the compiler. It seem to me that the main.Main entry point in ceylon/typechecker/src/main/Main.java is not the appropriate entry point for this use case (obtaining the typed tree and the attached models), because this information, which was collected by the visitors in the three checker passes is discarded, and only errors are printed. So,

Reified generics in Scala 2.10

天大地大妈咪最大 提交于 2019-12-03 04:48:14
问题 The lack of reified generics in Scala is the thing that bugs me the most about the language, since simple things cannot be implemented without using complicated constructs. Both Kotlin and Ceylon supports reified generics so its definitely possible to do so on top of the JVM. In the past it was said that Scala could not support them without a change in the JVM, but now Scala 2.10 is rumored to have limited support for reification. So my question is: What can we expect for reification in Scala

Reified generics in Scala 2.10

独自空忆成欢 提交于 2019-12-02 18:03:24
The lack of reified generics in Scala is the thing that bugs me the most about the language, since simple things cannot be implemented without using complicated constructs. Both Kotlin and Ceylon supports reified generics so its definitely possible to do so on top of the JVM. In the past it was said that Scala could not support them without a change in the JVM, but now Scala 2.10 is rumored to have limited support for reification. So my question is: What can we expect for reification in Scala 2.10, will I for example be able to implement a generic trait multiple times ?. Just how limited is it

Iterate enumerated class instances

牧云@^-^@ 提交于 2019-12-01 21:40:54
Is there a simple way to iterate over all enumerated instances of a class in Ceylon? Just like values() for Java enums? abstract class Suit() of hearts | diamonds | clubs | spades { shared formal String name; } object spades extends Suit() { name => "Spades"; } object clubs extends Suit() { name => "Clubs"; } object diamonds extends Suit() { name => "Diamonds"; } object hearts extends Suit() { name => "Hearts"; } Lets say I'd like to pick a random suit or I'd like to print all suits by their names. Edit: Explicitly adding all suits to an iterable works but we have to list all possible values