문제

I am trying to write a guard expression for my function which will not accept char lists, so I do this:

def myfunction(path) when is_list(path) do

the problem here is that is_list also returns true when a character list such as 'path' is given, how would I go about this?

도움이 되었습니까?

해결책

You could try is_binary. Will return true for Strings, false for Lists in the way you define it.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top