首页 > 其他分享 >无涯教程-Erlang - is_atom函数

无涯教程-Erlang - is_atom函数

时间:2023-12-06 12:31:42浏览次数:114  
标签:erlang fwrite atom1 无涯 start io atom Erlang

此方法用于确定术语是否确实是原子。

is_atom - 语法

is_atom(term)
  • term  -  这是需要判断其是否为原子的值。

is_atom - 返回值

如果条件值是一个原子,则返回true,否则将返回false。

-module(helloLearnfk). 
-export([start/0]). 

start() -> 
   io:fwrite(atom1), 
   io:fwrite("~n"), 
   io:fwrite("~p~n",[is_atom(atom1)]).

上面程序的输出如下。

atom1
true

参考链接

https://www.learnfk.com/erlang/erlang-is-atom.html

标签:erlang,fwrite,atom1,无涯,start,io,atom,Erlang
From: https://blog.51cto.com/u_14033984/8702004

相关文章

  • 无涯教程-Erlang - is_dir函数
    此方法用于确定目录是否确实是目录,此方法是filelib库的一部分。is_dir-语法is_dir(directoryname)directoryname - 这是目录名,是否为目录名。is_dir-返回值是的,如果目录存在并且确实是目录。-module(helloLearnfk).-export([start/0]).start()->io:fwrit......
  • 无涯教程-Erlang - copy函数
    此方法用于复制现有文件。copy-语法copy(source,destination)source     - 需要复制的源文件的名称。destination -文件的目标路径和名称。copy-示例-module(helloworld).-export([start/0]).start()->file:copy("Newfile.txt","Duplicate.......
  • AtomicArray
    AtomicIntegerai=newAtomicInteger(1);//1.获取值System.out.println("ai.get="+ai.get());//2.增加指定值并获取System.out.println("ai.addAndGet(2)="+ai.addAndGet(2));System.out.println("ai.get="+ai.get());//3.比较并设置1.预期值2.......
  • 无涯教程-Erlang - write函数
    此方法用于将内容写入文件。write-语法write(FileHandler,text)FileHandler-这是文件的句柄。该句柄是使用file:open操作时将返回的句柄。text        - 需要添加到文件中的文本。write-示例-module(helloLearnfk).-export([start/0]).sta......
  • 无涯教程-Erlang - file_read函数
    有一种方法可以允许一次读取文件的所有内容,这是通过file_read方法完成的。语法file_read(filename)参数filename-这是需要读取的文件名。返回值文件的全部内容。-module(helloLearnfk).-export([start/0]).start()->Txt=file:read_file("Newfile.txt"),i......
  • 无涯教程-Erlang - sort函数
    对元素列表进行排序。sort-语法sort(lst)Lst - 需要排序的元素列表。sort-返回值返回元素的排序列表。-module(helloLearnfk).-import(lists,[sort/1]).-export([start/0]).start()->Lst1=[5,6,4],io:fwrite("~p~n",[sort(Lst1)]).当我们运行......
  • 无涯教程-Erlang - reverse函数
    反转元素列表。reverse-语法reverse(lst)Lst  - 需要反转的元素列表。reverse-返回值返回元素的反向列表。-module(helloLearnfk).-import(lists,[reverse/1]).-export([start/0]).start()->Lst1=[1,2,3],io:fwrite("~p~n",[reverse(Lst1)]).......
  • 无涯教程-Erlang - merge函数
    返回通过合并ListOfLists的所有子列表形成的排序列表。merge-语法merge(ListsofLists)ListsofLists -需要合并的列表集合。merge-返回值返回元素的合并列表。-module(helloLearnfk).-import(lists,[merge/1]).-export([start/0]).start()->io:fwri......
  • 无涯教程-Erlang - last函数
    返回列表的最后一个元素。last-语法last(lst1)Lst1-元素列表。last-返回值返回列表的最后一个元素。-module(helloLearnfk).-import(lists,[last/1]).-export([start/0]).start()->Lst1=[1,2,3,4],io:fwrite("~w~n",[last(Lst1)]).当我们运行上述......
  • 无涯教程-Erlang - any函数
    如果List中的至少一个存在一个元素则返回true,则返回true。any-语法any(Pred,lst)Pred-将应用于字符串的断言函数Lst  -值列表any-返回值如果Pred(Elem)对List中的至少一个元素Elem返回true,则返回true。-module(helloLearnfk).-import(lists,[any/2]).-e......