@@ -829,7 +829,7 @@ impl Executor {
829
829
self . stack . push ( Type :: Number ( len) ) ;
830
830
}
831
831
832
- // Define variable
832
+ // Define variable at memory
833
833
"var" => {
834
834
let name = self . pop_stack ( ) . get_string ( ) ;
835
835
let data = self . pop_stack ( ) ;
@@ -840,7 +840,7 @@ impl Executor {
840
840
self . show_variables ( )
841
841
}
842
842
843
- // Get data type
843
+ // Get data type of value
844
844
"type" => {
845
845
let result = match self . pop_stack ( ) {
846
846
Type :: Number ( _) => "number" ,
@@ -874,21 +874,21 @@ impl Executor {
874
874
self . stack . push ( Type :: List ( list) )
875
875
}
876
876
877
- // Free memory
877
+ // Free up memory space of variable
878
878
"free" => {
879
879
let name = self . pop_stack ( ) . get_string ( ) ;
880
880
self . memory . remove ( name. as_str ( ) ) ;
881
881
self . show_variables ( ) ;
882
882
}
883
883
884
- // Copy value
884
+ // Copy stack's top value
885
885
"copy" => {
886
886
let data = self . pop_stack ( ) ;
887
887
self . stack . push ( data. clone ( ) ) ;
888
888
self . stack . push ( data) ;
889
889
}
890
890
891
- // Swap value
891
+ // Swap stack's top 2 value
892
892
"swap" => {
893
893
let b = self . pop_stack ( ) ;
894
894
let a = self . pop_stack ( ) ;
@@ -898,7 +898,7 @@ impl Executor {
898
898
899
899
// Commands of times
900
900
901
- // Get now time
901
+ // Get now time as unix epoch
902
902
"now-time" => {
903
903
self . stack . push ( Type :: Number (
904
904
SystemTime :: now ( )
0 commit comments