1
1
mirror of https://github.com/kanaka/mal.git synced 2024-08-18 02:00:40 +03:00

Change os.clock multiplier, update Dockerfile to use lua 5.3.5.5

This commit is contained in:
Gabriel M 2020-05-17 14:23:54 -03:00
parent 024e0b0415
commit d4fc4551a0
2 changed files with 17 additions and 5 deletions

View File

@ -22,9 +22,22 @@ WORKDIR /mal
##########################################################
# Lua
RUN apt-get -y install lua5.2 liblua5.2-dev lua-rex-pcre luarocks
RUN luarocks install linenoise
RUN luarocks install luasocket
RUN apt-get -y install gcc wget unzip libpcre3-dev
RUN \
curl -R -O http://www.lua.org/ftp/lua-5.3.5.tar.gz && \
tar -zxf lua-5.3.5.tar.gz && \
cd lua-5.3.5 && \
make linux test && \
make install
RUN \
wget https://luarocks.org/releases/luarocks-3.3.1.tar.gz && \
tar zxpf luarocks-3.3.1.tar.gz && \
cd luarocks-3.3.1 && \
./configure && \
make && \
make install
# luarocks .cache directory is relative to HOME
ENV HOME /mal

View File

@ -3,7 +3,6 @@ local types = require('types')
local reader = require('reader')
local printer = require('printer')
local readline = require('readline')
-- local socket = require('socket')
local Nil, List, HashMap, _pr_str = types.Nil, types.List, types.HashMap, printer._pr_str
@ -278,7 +277,7 @@ M.ns = {
['-'] = function(a,b) return a-b end,
['*'] = function(a,b) return a*b end,
['/'] = function(a,b) return math.floor(a/b) end,
['time-ms'] = function() return math.floor(os.clock()*1000) end,
['time-ms'] = function() return math.floor(os.clock()*1000000) end,
list = function(...) return List:new(table.pack(...)) end,
['list?'] = function(a) return types._list_Q(a) end,