Elixir 대화 식 셸: 2. 상용 명령
이것 은
IEx   5 부분 중의 두 번 째 부분 입 니 다. 이 부분 에서 우 리 는 IEx 의 명령 을 어떻게 사용 하 는 지 설명 할 것 입 니 다.보충 하여 완전 하 게 하 다
IEx 에 숫자 입력
Elixir 을 한 후 Tab 키 를 누 르 면 불완전한 결 과 를 나타 낸다.iex(60)> Elixir.
Access                    Agent                     Application               
ArgumentError             ArithmeticError           Atom                      
BadArityError             BadFunctionError          BadMapError               
BadStructError            Base                      Behaviour                 
Bitwise                   CaseClauseError           Code                      
Collectable               CompileError              CondClauseError           
Dict                      Elixir                    Enum                      
Enumerable                ErlangError               Exception                 
File                      Float                     FunctionClauseError       
GenEvent                  GenServer                 HashDict                  
HashSet                   IEx                       IO                        
Inspect                   Integer                   Kernel                    
KeyError                  Keyword                   List                      
Logger                    Macro                     Map                       
MapSet                    MatchError                Module                    
Node                      OptionParser              Path                      
Port                      Process                   Protocol                  
Range                     Record                    Regex                     
RuntimeError              Set                       Stream                    
String                    StringIO                  Supervisor                
SyntaxError               System                    SystemLimitError          
Task                      TokenMissingError         TryClauseError            
Tuple                     URI                       UndefinedFunctionError    
UnicodeConversionError    Version            모든
Enum 모듈 에서 알파벳 m 으로 시작 하 는 함수iex(60)> Enum.m
map/2           map_join/3      map_reduce/3    max/1           
max_by/2        member?/2       min/1           min_by/2        
min_max/1       min_max_by/2도와 주기
h/0, h/1h 명령 을 통 해 모듈 문서, 모듈 함수 문 서 를 볼 수 있 습 니 다.h/0 디 스 플레이 IEx.Helpers 문서 h/1 는 모듈, 함수 문 서 를 표시 합 니 다.모듈 문서 보이 기
iex(60)> h Enum     함수 문서 보이 기
iex(62)> h Enum.reduce파일 및 디 렉 터 리 보조 기능
현재 디 렉 터 리 보이 기
iex(1)> pwd
/ElixirProjects/distributed/distro현재 디 렉 터 리 의 파일 과 하위 디 렉 터 리 를 보 여 줍 니 다. 시스템 도구
ls 와 유사 합 니 다.iex(2)> ls
.editorconfig      .git               .gitignore         README.md          _build             
abc.sh             bcd.sh             config             def.sh             deps               
erl_crash.dump     lib                mix.exs            mix.lock           rel                
test현재 IEx Shell 을 다시 시작 합 니 다. 값 번 호 는
(1)iex(4)> respawn
Interactive Elixir (1.2.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> 자세 한 명령 목록 은 IEx Shell 에 직접 입력
h 하여 볼 수 있 습 니 다.iex(1)> h
...
  • b/1           - prints callbacks info and docs for a given module
  • c/2           - compiles a file at the given path
  • cd/1          - changes the current directory
  • clear/0       - clears the screen
  • flush/0       - flushes all messages sent to the shell
  • i/1           - prints information about the given data type
  • h/0           - prints this help message
  • h/1           - prints help for the given module, function or macro
  • import_file/1 - evaluates the given file in the shell's context
  • l/1           - loads the given module's beam code
  • ls/0          - lists the contents of the current directory
  • ls/1          - lists the contents of the specified directory
  • pid/3         — creates a PID with the 3 integer arguments passed
  • pwd/0         — prints the current working directory
  • r/1           — recompiles and reloads the given module's source file
  • respawn/0     — respawns the current shell
  • s/1           — prints spec information
  • t/1           — prints type information
  • v/0           — retrieves the last value from the history
  • v/1           — retrieves the nth value from the history
  • import_file/1 — evaluates the given file in the shell's context
...
iex(2)> 이전 값 에 접근
➜  iex
iex(1)> :os.timestamp
{1460, 298263, 550140}
iex(2)> v(-1)
{1460, 298263, 550140}
iex(3)> v(2)
{1460, 298263, 550140}#iex:break  입력 이 잘못 되 어 도저히 끝 날 수 없 을 때 입력
#iex:break 을 입력 하여 현재 줄 의 입력 을 끝 냅 니 다. Ctrl + C 을 사용 하여 IEx 세 션 을 끝 낼 필요 가 없습니다.아래 의 입력 을 시도 해 보 세 요.
#iex:break 의 효 과 를 볼 수 있 습 니 다.iex(60)> list = [
...(60)> :a, "abc, :b]
...(60)> "
...(60)> ???
iex:63: warning: found ? followed by codepoint 0xA (newline), please use 
 instead
...(60)> ;
iex:63: warning: found ? followed by codepoint 0xA (newline), please use 
 instead
...(60)> .
iex:63: warning: found ? followed by codepoint 0xA (newline), please use 
 instead
...(60)> #iex:break 이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSONJSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다. 그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다. 저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.