`
ZacMa
  • 浏览: 37668 次
  • 来自: 深圳
社区版块
存档分类
最新评论

<26>io:format io_lib:format

 
阅读更多
使用io_lib时候要注意参数,尤其是封装json串的时候,否则可能导致封装错误
看shell中的使用结果就知道,我在使用mochijson2 封装时候刚开始导致前端不能解析

网上看到这样一段解释
io:format(Format, Args) uses io_lib:format(Format, Args) to create the [size=large][/size]
data that is written to stdout, so there should be absolutely no
difference in the result. Apart from that io_lib:format/2 returns a deep
string, and io:format/2 just does a side effect.

io:put_chars(io_lib:format(Format, Args)) would be exactly equivalent to
io:format(Format, Args).

The feature in io_lib:format/2's return value is that the string need
not be flattened if it is supposed to be sent to e.g io:put_chars/1,
file:write/2 or erlang:port_command/2. It is a perfectly valid IO-list
and it is wasting time to flatten it if it is not needed.
http://erlang.org/pipermail/erlang-questions/2003-February/007683.html
  • 大小: 61.1 KB
分享到:
评论

相关推荐

    ( ap6181_sina33m_sc3817r验证通过_20170710_1608没有外层目录.7z

    &lt;integer name="def_screen_off_timeout"&gt;1800000&lt;/integer&gt; &lt;bool name="def_lockscreen_disabled"&gt;true&lt;/bool&gt; 7、请严重注意,全志在这里埋坑了!(坑爹无敌!) Android里面调入配置文件:nvram.txt,里面...

    Erlang简易编译环境 EditPlus + 批处理 + 本文 实现简易编译(含erlang.stx)

    {ok, Reason} -&gt; io:format("~p~n", [{ok, Reason}]); Val -&gt; io:format("~p~n", [Val]) end end. compile_release(File) -&gt; begin case compile:file(File) of {ok, Reason} -&gt; io:format("~p~n", [{ok, ...

    r40_tinav2.1_最终验证通过_使用CB-S来验证OV5640有横条纹fpscamera+SPI2.0成功_20171114_1443没有外层目录.7z

    //frame format: /dev/frame_x (x:0~21) if(cap-&gt;cmd == SAVE_FRAME || cap-&gt;save_status == ON ) { if(cap-&gt;cmd == SAVE_FRAME){ cap-&gt;save_status = ON; cap-&gt;cmd = COMMAND_UNUSED; } ret = do_save_...

    freemarker总结

    其它的运行符可以作用于数字和日期,但不能作用于字符串,大部分的时候,使用gt等字母运算符代替&gt;会有更好的效果,因为 FreeMarker会把&gt;解释成FTL标签的结束字符,当然,也可以使用括号来避免这种情况,如:&lt;#if (x&gt;y)&gt; ...

    r58_evb_sc5806v4加载TP成功修改config 20160815 2026.7z

    cp sunxi_schw.ko /home/rootroot/wyb/r58_evb_sc5806/lichee/linux-3.4/output/lib/modules/3.4.39/ make:离开目录“/home/rootroot/wyb/r58_evb_sc5806/lichee/linux-3.4/modules/aw_schw” build gpu module for ...

    springmybatis

    查询出列表,也就是返回list, 在我们这个例子中也就是 List&lt;User&gt; , 这种方式返回数据,需要在User.xml 里面配置返回的类型 resultMap, 注意不是 resultType, 而这个resultMap 所对应的应该是我们自己配置的 ...

    tomcat8 + nginx + memcached + cas 实现负载均衡的配置包

    &lt;WatchedResource&gt;${catalina.base}/conf/web.xml&lt;/WatchedResource&gt; &lt;!-- Uncomment this to disable session persistence across Tomcat restarts --&gt; &lt;!-- &lt;Manager pathname="" /&gt; &lt;Resources ...

    LogIo:日志IO是用于访问测井文件的库

    日志I / O-用于访问测井文件的库日志I / O是用于读取和写入良好日志文件的库。 从Q1 / 2021开始,Log I / O支持...依存关系JSON Well Log Format访问器取决于JSON API规范及其实现: lib/javax.json-api-1.1.3.jarlib/j

    jpivot学习总结.doc

    &lt;Level name="地区" uniqueMembers="true" nameColumn="ORGENTITYNAME" column="ORGENTITYID" parentColumn="ORGENTITYPARENT" nullParentValue="null"&gt; &lt;Closure parentColumn="ORGENTITYPARENT" childColumn=...

    elkm1:ElkM1 Python软件包

    具有面板的IO通过TCP或串行端口异步。 安装 $ pip install elkm1_lib 概述 与麋鹿面板的基本连接: from elkm1_lib import Elk import logging # Print to STDOUT LOG = logging . getLogger ( __name__ ) ...

    apktool documentation

    -p, --frame-path &lt;dir&gt; - Store framework files into &lt;dir&gt; -t, --tag &lt;tag&gt; - Tag frameworks using &lt;tag&gt; Allow for a finer control over how the files are named and how they are stored. $ apktool if ...

    date-time-format:日期时间格式

    script src =" http://lightspeedworks.github.io/date-time-string/lib/date-time.js " &gt; &lt;/ script &gt; 用法: 简单的功能 var DateTime = require ( 'date-time-string' ) ; console . log ( DateTime ....

    hadoop_the_definitive_guide_3nd_edition.pdf

    &lt;output path&gt;"); System.exit(-1); } Job job = new Job(); job.setJarByClass(MaxTemperature.class); job.setJobName("Max temperature"); FileInputFormat.addInputPath(job, new Path(args[0])); ...

    glew-2.1.0.tgz

    Targets: `all, glew.lib (sub-targets: glew.lib.shared, glew.lib.static), glew.bin, clean, install, uninstall` Variables: `SYSTEM=linux-clang, GLEW_DEST=/usr/local, STRIP=` _Note: may need to make **...

    VBA API 32 Serialport MT-SICS

    Private Const FORMAT_MESSAGE_FROM_SYSTEM = &H1000 Private Const OPEN_EXISTING = 3 ' COMM Functions Private Const MS_CTS_ON = &H10& Private Const MS_DSR_ON = &H20& Private Const MS_RING_ON = &H40& ...

    acpi控制笔记本风扇转速

    independent acpica.lib produced by the Microsoft Visual C++ 6.0 32- bit compiler. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. ...

    8-07-14_MegaCLI for linux_windows

    LSIP200232921 (DFCT) MegaCLI displays version for PD in unclear format and the data is not aligned correctly LSIP200232954 (DFCT) Need to Support all the MFC default values in the command AdpSettings...

    Bochs - The cross platform IA-32 (x86) emulator

    [2960379] Fix build with -Wformat -Werror=format-security by Per Oyvind Karlsen [2938273] allow instrumentation to change execute by Konrad Grochowski [2926072] Indirection operators in expressions...

    Excel数据操纵-jar包-jxl.jar

     InputStream-&gt;Workbook-&gt;Sheet-&gt;Cell,就得到了excel文件中的单元格  代码:  String path="c:\\excel.xls";//Excel文件URL  InputStream is = new FileInputStream(path);//写入到FileInputStream  jxl....

    通过java操作excel表格的工具类库jxl

     InputStream-&gt;Workbook-&gt;Sheet-&gt;Cell,就得到了excel文件中的单元格  代码:  String path="c:\\excel.xls";//Excel文件URL  InputStream is = new FileInputStream(path);//写入到FileInputStream  jxl....

Global site tag (gtag.js) - Google Analytics