HuangHaiFeng

Results 20 comments of HuangHaiFeng

我现在使用的是中文系统,是不是说我的机器必须装阿拉伯字体? 你所说的: ``` 绘制多语言根据不同语言文字加载不同字体 ``` 不是很明白。能否说的更详细一点? 从图中可以看到,实际上韩文是可以正确显示的(1-3种情况),而且阿拉伯文也可以正确显示的(第四种情况)。 但是当韩文和阿拉伯文混在一起的时候,阿拉伯文显示正常,韩文显示不正常。

项目使用的是unicode编码。代码是使用的`https://github.com/netease-im/NIM_PC_Demo`仓库的源码。真正出错的地方在 `https://github.com/netease-im/NIM_PC_Demo/blob/master/tool_kits/ui_component/ui_kit/gui/session/control/bubbles/bubble_text.cpp` ```cpp void MsgBubbleText::SetMsgText( const std::wstring &str ) { if(str.empty()) { text_->SetFixedWidth(10); text_->SetFixedHeight(20); } else { text_has_emoji_ = InsertTextToEdit(text_, str) > 0; } } ``` 我使用调试器看过这里的`str`变量,调试器显示的内容完全正确,但是显示到界面上就是乱码。 我甚至将str的内容直接写成常量字符串试了一下,同样的乱码。 ```cpp std::wstring...

When you implement the `fmt` package's `Formatter` interface, you can utilize the golang's handling of formt. In the project [monkey](https://github.com/haifenghuang/monkey), I've implemented a fmt module, which does the formatting of...

两种函数语法应该说没有太大区别。在`parser.go`文件中,`parseFunctionLiteral`返回的是一个 `FunctionLiteral`。同样`parseFatArrowFunction`函数返回的也是一个`FunctionLiteral`。 使用`=>`语法在一定程度会更加方便。例如,下面的两段代码运行结果相同: ```swift let x = (a, b) => a + b printf("x(1,2)=%d\n", x(1,2)) //Output: x(1,2)=3 ``` ```swift let x = fn(a, b) { a + b } printf("x(1,2)=%d\n",...

这里出错的原因是,我将所有let声明的变量作为一个类的Member变量,而非Method了。更改的话,只需要将`parser.go`文件的`parseClassLiteral`函数中处理`LetStatement`的地方更改一下即可,`eval.go`不需要变更。 具体更改如下: ```swift // parser.go的parseClassLiteral函数的部分实现: cls.Block = p.parseClassBody(false) for _, statement := range cls.Block.Statements { switch s := statement.(type) { case *ast.LetStatement: //class fields // For simplicity, we need 'let'...

如果我的理解没有错误的话,对于普通字段: ```swift class Calc { let add = (x,y) => x + y ; } ``` 直接解析报告类似如下的错误: ``` Syntax Error: Could not define function-literal in class's let-statement ``` 关于定义方法需要特殊的语法,我认为这个建议也可以接受。不过这样的话,需要加入不少的代码。这个我会考虑。如果时间允许的话,考虑会加入此功能。 不过如果你能够贡献代码的话,非常欢迎您的`pull...

关于你说的“定义方法需要更特殊的语法”这一点,我有一个自认为更好的方法,就是在方法后面加'&'。像下面这样: ```swift class Calc { let add = (x,y) => x + y ; } let c = new Calc(); let exec = (op,x,y) => op(x,y); w = exec(c.add&,1,2); //注意add后面的'&'符号...

谢谢你的思路,你说的很有道理。至于代码,你有任何不懂的地方,请随时联系我, 我也很乐意提供帮助。下面是我的邮箱地址: | 工作邮箱 | 163邮箱 | | ------------------------------ | --------------------------- | | `[email protected]` | `[email protected]` |

我这里也出现大致的问题。 ![微信图片_20201021000737](https://user-images.githubusercontent.com/4425219/96613460-9475b780-1331-11eb-838c-ed7d4c9d985d.jpg) ``` 信息的上部分为接收的信息,下半部分为翻译的信息。 ``` 三处接收的信息的韩文是相同的,但是划红框部分的内容的韩文显示不正确,其它两处显示正确。代码是同一份代码。

When designing the `magpie` language, I want the language to support these. But it's not that easy. If I implement these, the source code must be redesigned. That's a lot...