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

无涯教程-Erlang - is_tuple函数

时间:2023-12-06 19:32:46浏览次数:39  
标签:返回 erlang tuple 无涯 元组 start Erlang true

此方法用于确定所提供的术语确实是元组。

is_tuple - 语法

is_tuple(tuple)
  • tuple - 这是要验证的元组是否真的是元组。

is_tuple - 返回值

如果确实输入的值是元组,则返回true,否则将返回false。

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

start() -> 
   P={john,24,{june,25}} , 
   io:fwrite("~w",[is_tuple(P)]).

上面程序的输出如下-

true

参考链接

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

标签:返回,erlang,tuple,无涯,元组,start,Erlang,true
From: https://blog.51cto.com/u_14033984/8709200

相关文章

  • 无涯教程-Erlang - keys函数
    此方法用于从Map返回所有键。keys-语法keys(map)map - 这是需要为其返回所有键的映射。keys-返回值返回Map中的键列表。-module(helloLearnfk).-export([start/0]).start()->Lst1=[{"a",1},{"b",2},{"c",3}],Map1=maps:from_list(Lst1),io:f......
  • Erlang&Rabbitmq安装
    一.安装erlang1wgethttp://www.erlang.org/download/otp_src_19.3.tar.gz解压1tar-xvfotp_src_19.3.tar.gz进入文件夹1cdotp_src_19.3配置1./configure--prefix=/home/erlang--without-javac如果报错:1configure:error:Nocurseslibraryfunct......
  • 无涯教程-Erlang - get函数
    此方法用于获取映射中特定键的值。get-语法get(key,map)key   - 这是需要为其返回值的键。Map  - 这是需要在其中搜索键的Map。get-返回值如果在Map上找到键,则返回值。-module(helloLearnfk).-export([start/0]).start()->Lst1=[{"a",1},{"......
  • 无涯教程-Erlang - find函数
    此方法用于查找Map中是否存在特定键。find-语法find(key,map)key  - 这是需要转换为Map的列表。Map- 这是需要在其中搜索键的Map。find-返回值如果在Map上找到键,则返回值。-module(helloLearnfk).-export([start/0]).start()->Lst1=[{"a",1},{"b"......
  • 无涯教程-Erlang - list_to_atom函数
    此方法用于将列表项转换为原子。list_to_atom-语法list_to_atom(listvalue)listvalue - 这是需要转换为原子的列表值。list_to_atom-返回值基于列表值输入的原子。-module(helloLearnfk).-export([start/0]).start()->io:fwrite("~p~n",[list_to_atom("a......
  • 无涯教程-Erlang - is_atom函数
    此方法用于确定术语是否确实是原子。is_atom-语法is_atom(term)term - 这是需要判断其是否为原子的值。is_atom-返回值如果条件值是一个原子,则返回true,否则将返回false。-module(helloLearnfk).-export([start/0]).start()->io:fwrite(atom1),io:fw......
  • 无涯教程-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.......
  • 无涯教程-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......