问题标签 [ceylon]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
ceylon - 在锡兰哪里会使用 noop
我正在玩弄这种美丽的语言,并看到了一个名为noop
.
正如文档所说,它是一个什么都不做的 void 函数!
那么为什么我要使用一个什么都不做的函数呢?是为了在装配中添加“Nop”(用于管道等)但是这太低级了,不是吗?
performance - 为什么递归阶乘比锡兰的折叠更快
我有这个锡兰代码:
在第 1 行,我使用 fold 来计算阶乘,得到的性能在 0.08 到 0.06 秒之间。
现在,如果我用这个替换第 1 行:
我的性能介于 0.021 和 0.012 之间,这是为什么呢?
在这种情况下,我尝试的数字是 10。
tuples - 你可以给元组类型起别名吗?
我正在玩 Ceylon,我正在尝试为元组创建别名。以下不起作用:
我在前两个上遇到的错误围绕着括号的使用:
第二个有两个单独的错误:
的一些变化
开class MyPair
和
在f
, [f]
, 或元组构造上。
有没有办法做到这一点?
google-closure-compiler - Compile Ceylon Js Code with Google Closure Compiler in Advanced Mode
What is the recommended way to optimally minimize the size of ceylon javascript code?
ceylon - Ceylon 1.2 Binary Compatibility
I tried to compile a source with Ceylon compiler version 1.2 that I previously compiled successfully with Ceylon compiler version 1.1 and I get the following error messages:
I suppose that " ... binary version 8.0 ... " in the error message refers to the Java version.
In both attempts to compile (first with Ceylon 1.1, second with 1.2) I used Java version 8 and I dont want to change that back to 7.
Does it help to compile the Ceylon SDK with Java version 8? How can I do that separately from the entire Ceylon distribution?
How can I import the sources of Ceylon SDK into my project and compile it together with my project?
ceylon - Ceylon 1.2 版格式命令
我该如何解决:
命令:
例外:
我想我必须重新安装格式化程序。但是哪个版本?
无缘无故以下命令有效:
ceylon run ceylon.formatter source/com/example/helloworld/*.ceylon
区别在哪里,我该如何解决。
ceylon - 附加到锡兰的序列
如何将单个元素附加到 Ceylon 的列表中?我试过这样的append
方法,但它只接受另一个列表:
显然,我可以通过包装元素来解决:
但我觉得应该有更好的方法......
code-generation - 如何在 Ceylon 编写代码生成器
我想编写一个代码生成器,它根据另一个锡兰类的元模型生成一个类。我希望代码生成器在编译时运行。对我来说最好的方法是什么。我可能可以通过为 gradle 或 ceylon 构建系统编写插件来实现这一点,但我希望有一个更简单的解决方案。不幸的是,我没有看到锡兰对代码生成器的任何支持。另外,锡兰有代码生成器的计划吗?
我想编写这个代码生成器,因为我正在考虑为 ceylon 编写一个简单的 Web 框架,它使用元模型查看如下所示的类:控制器
我计划让它像 Spring MVC 一样。这个框架将从 Controller 类中创建一个宁静的 API,允许人们像这样编写 AJAX 调用:
我想通过 GWT 之类的东西让事情变得更方便、更高级、更简单。我想创建一个自动生成这样的类的代码生成器:
RemoteController 将作为 javaScript 在用户的浏览器中运行,并允许客户端 ceylon 代码执行 Ajax 调用,如下所示:
这最终会调用服务器上的 Controller().doSomething() 所以“做到了!” 将被打印。
ceylon - 如何在网页中使用锡兰代码?
我正在尝试根据本教程ceylon.language-1.2.0-model.js 在网页中使用 javaSCript。我在哪里可以得到那个。还有比该教程中描述的更简单的方法吗?
maven - 是否可以将 Ceylon 与 Maven 和/或 Gradle 和/或 SBT 一起使用?
我看到 Ceylon 需要 Ant 并且有自己的构建系统。
是否可以在常用构建工具中编译 Ceylon 文件?