惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

MyScale Blog
MyScale Blog
MongoDB | Blog
MongoDB | Blog
The Register - Security
The Register - Security
T
The Blog of Author Tim Ferriss
A
About on SuperTechFans
Vercel News
Vercel News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Jina AI
Jina AI
Stack Overflow Blog
Stack Overflow Blog
Cisco Talos Blog
Cisco Talos Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
W
WeLiveSecurity
S
Securelist
I
Intezer
F
Full Disclosure
WordPress大学
WordPress大学
腾讯CDC
酷 壳 – CoolShell
酷 壳 – CoolShell
Latest news
Latest news
aimingoo的专栏
aimingoo的专栏
C
Cisco Blogs
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
The Exploit Database - CXSecurity.com
P
Proofpoint News Feed
K
Kaspersky official blog
阮一峰的网络日志
阮一峰的网络日志
P
Proofpoint News Feed
J
Java Code Geeks
人人都是产品经理
人人都是产品经理
雷峰网
雷峰网
AWS News Blog
AWS News Blog
T
Tenable Blog
Google DeepMind News
Google DeepMind News
B
Blog RSS Feed
L
LINUX DO - 最新话题
小众软件
小众软件
T
Threat Research - Cisco Blogs
C
Cyber Attacks, Cyber Crime and Cyber Security
The GitHub Blog
The GitHub Blog
爱范儿
爱范儿
N
News and Events Feed by Topic
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
量子位
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Forbes - Security
Forbes - Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
U
Unit 42
O
OpenAI News
V
V2EX
T
Troy Hunt's Blog

Kotlin

compose 使用性能问题 - V2EX 有人在项目里面使用 compose 开发吗 - V2EX 大家会在老项目中使用 kotlin 吗 - V2EX Kotlin 中文文档 2.2.20 版翻译完成了 - V2EX Kotlin 中文文档 2.1.20 版翻译完成了 - V2EX Kotlin 中文文档 2.1.0 版翻译完成了 - V2EX Kotlin 中文文档 2.0.20 版翻译完成了 - V2EX MIUI API28+ActivityTransition API+kotlin 无法检测到活动,只能手动触发广播,怎么定位问题? - V2EX 我老人家翻译的 Kotlin 中文文档,正在更新到最新的 2.0.20 版 - V2EX 我老人家翻译的《Kotlin 语言参考文档》中文版,已经迁移到了新的 Writerside 环境 - V2EX kotlin 没有受检异常真太难顶了。吐槽 - V2EX 屎山代码一则 - V2EX Kotlin 2.0.0 正式版发布了 - V2EX kotlin 中的 select 到底可以 select 哪些内容啊? - V2EX 请大佬帮忙看一眼我这个注解为什么没能抑制 never used 警告? - V2EX 我老人家翻译的《Kotlin 语言参考文档》中文版 - V2EX 使用 compose 开发了讯飞星火认知模型桌面端应用 - V2EX Kotlin 的协程到底是用来干嘛的?为什么没有可 suspend 的异步 IO 函数? - V2EX Kotlin 协程 Coroutine 与 Spring Boot 项目整合的最佳实践是怎样的? - V2EX 谷歌出品 kotlin 入门教程 - V2EX kotlin 源代码数据集 - V2EX KMM 中目前最成熟,最推荐的 shared viewmodel 方案是什么. - V2EX ​ Java /kotlin AST 构建相关,悬赏 200 求解,人已经麻了 - V2EX 有没有 Kotlin 讲协程比较好的书籍或博客连载 - V2EX ArrayList.set 提示 第二个参数 element 类型是 NoThing ? - V2EX 哪些公司后端用 kotlin 写的 - V2EX 最近在看 Kotlin 别人一些代码, 看到如下的代码惊呆了 - V2EX Kotlin 的协程是真协程吗?被 b 站博主搞蒙了 - V2EX 有没有人能帮我解释一下,这里面的代码.如果我创建一个新窗口,按照这个逻辑,怎么显示出来 - V2EX 怎么解决 public reified 函数会要求所有用到的依赖都是 public 的问题 - V2EX Result 的方式处理异常用的多吗,我看了下好像和比较受好评的 rust result 用法差不多 - V2EX Kotlin 更换了新 logo:更加立体、更加清晰 - V2EX Kotlin 1.5.20 发布了~快来看看新特性 - V2EX 关于 kotlin 处理多个可空类型的变量的问题 - V2EX 求解这个 eval 函数返回值为什么是个 lambda?怎么才能拿到值? ​​​ - V2EX kotlin lazy 形式的 grouping and mapping 应该怎么写, sequence 里 grouping + aggregate 怎么比 Java stream 还复杂得多 - V2EX 强大的 v2ex,大家擅长 Kotlin, webview 交互的伙伴,来一波 - V2EX springboot kotlin 和 Java 混编, json 序列化用哪个比较好 - V2EX 有哪些知名 iOS 应用是纯 Kotlin 开发的? - V2EX [协程递归问题请教] - V2EX kotlin 打包问题 - V2EX 求推荐 kotlin 安卓开发教程 - V2EX Kotlin 1.4 Released - V2EX 请教一下 kotlin json 序列化及配合 data class 的正确姿势 - V2EX 各位公司项目后端有用 Kotlin + Spring 的吗, DB 层框架选用的什么? - V2EX 慌的一批, Kotlin 这么优雅的语言为什么不火呢 - V2EX Kotlin 如何检测所有 lateinit 的 field 是否初始化 - V2EX 初入 kotlin,源码找不见求教 - V2EX libcore.reflect.parameterizedtypeimpl cannot be cast to Java .lang.clas 这个错误 我真是莫名其妙 - V2EX
kotlin 表达式引擎 - V2EX
bootvue · 2022-07-27 · via Kotlin

bootvue

V2EX  ›  Kotlin

 

bootvue · 2022 年 7 月 27 日 · 4448 次点击

这是一个创建于 1418 天前的主题,其中的信息可能已经有所发展或是发生改变。

字符串表达式 "s1 + ( s2 - s3 )" 集合 s1 s2 s3

kotlin 中怎么让预定义的字符串作为表达式执行 实现类似 js 中 eval ( "表达式" )的效果 执行完返回集合类型的结果

  • Kotlin
  • 字符
  • 表达
  • 集合

    4 条回复    2022-07-27 16:33:24 +08:00

    U2FSDGVK

    1

    U2FSDGVK      2022 年 7 月 27 日

    这个问题我也查过一些,最后找到的是用 kotlin-script 运行字符串
    参考:
    https://stackoverflow.com/questions/56384889/run-kotlin-stored-as-a-string-is-giving-a-runtime-error
    https://stackoverflow.com/questions/49416321/kotlin-dynamically-compile-a-class-from-source-code-at-runtime
    实际用起来 kotlin-script 编译挺慢的

    Belmode

    3

    Belmode      2022 年 7 月 27 日

    让字符串表达式生成临时 kts 文件,然后再用 kotlin 调用外部命令执行这个 kts ,读取返回结果。

    yazinnnn

    4

    yazinnnn      2022 年 7 月 27 日

    https://github.com/Kotlin/kotlin-script-examples/blob/master/jvm/jsr223/jsr223.md

    resource/META-INF/services/javax.script.ScriptEngineFactory 中写入
    kotlin.script.experimental.jsr223.KotlinJsr223DefaultScriptEngineFactory

    https://gist.github.com/yazinnnn/9c7de3320c63f3f5bd5be2df6cc05665

    不知道你出于啥目的有这个需求, 如果只是学习的话, 不如直接启动一个 repl