簡體   English   中英

錯誤function_clause?

[英]Error function_clause?

為什么這不起作用? 無法弄清楚這一點。 似乎是字符串匹配方式的東西。 我一直收到錯誤error:function_clause

-module(rna_transcription).
-export([to_rna/1, to_rna_nucleotide/1]).

to_rna(DNA) -> lists:map(fun to_rna_nucleotide/1, DNA).

to_rna_nucleotide("G") -> "C";
to_rna_nucleotide("C") -> "G";
to_rna_nucleotide("T") -> "A";
to_rna_nucleotide("A") -> "U".

string的元素是char類型,而不是string。

to_rna_nucleotide($G) -> $C;
to_rna_nucleotide($C) -> $G;
to_rna_nucleotide($T) -> $A;
to_rna_nucleotide($A) -> $U.

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM