问题标签 [polyml]

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.

0 投票
1 回答
309 浏览

sml - 我不知道如何使用 PolyML 打开和运行 sml 文件

我对 SML 完全陌生,我不明白我应该做什么才能使用 PolyML 创建、编辑、编译和运行 sml 文件。我正在使用 Windows,我不知道是否需要下载另一个 IDE,或者像 Java 这样的开发工具包。

我想创建定义了一些函数的文件,然后由终端使用它们。

0 投票
2 回答
59 浏览

recursion - StandardML 因子评估在 Poly/ML REPL 中进入无限循环

以下阶乘函数很好......

但以下将 Poly REPL 带入无限循环。

想知道这可能是什么原因造成的?

0 投票
1 回答
20 浏览

polyml - 在 Debian 10 Buster 上使用 polyc 编译时出错

“/usr/bin/ld: 找不到 -lpolyml”

在 Debian 10 上使用 polyc 编译源 sml 文件时收到此错误。

0 投票
4 回答
107 浏览

sml - 为什么我会为一个简单地为列表中的每个整数添加一个值的函数出现此错误?

这是我的功能:

l是一个整数列表,我试图添加incl.

但我收到了这些错误

而且我不明白为什么,因为我有一个几乎相同的函数,可以将值相乘,效果很好。

0 投票
1 回答
31 浏览

sml - 导致 SML 错误的原因:Exception-InternalError: asGenReg 在编译时引发

我正在学习 SML,但无法弄清楚为什么以下教科书代码会产生错误:

错误是:

这适用于 Poly/ML 5.7.1。

该代码计算复数的倒数(x,y)。我尝试;在地方添加和括号无济于事。

奇怪的是,以下更改(不正确)的定义可以正常工作。

错误消息的信息量不是很大。

有人可以帮助解释错误在哪里以及如何解决吗?

0 投票
2 回答
68 浏览

colors - PolyML colored output to terminal in Linux

Ideally, this line of PolyML code should give desired result:

But the \033 turns out to be just an exclamation mark, not a special symbol for color encoding. I use the following "way-around" approach, but it doesn't allow to do anything interactively: I just take the output of my program and color it.

What are the possible solutions to this problem? Is it possible to solve it within the standard PolyML instruments?

added: I checked how Ocaml do the same thing with

-- situation is the same: no color obtained.

p.s. this question is not a dublicate because it is about differences between echo -e and print in ML languages