Comparisons taken from bram's reasoning for vim9
let start = reltime()
function VimNew()
let sum = 0
for i in range(1, 2999999)
let sum = sum + i
endfor| local lua_dirs = vim.fn.glob("./lua/*", 0, 1) | |
| for _, dir in ipairs(lua_dirs) do | |
| dir = string.gsub(dir, "./lua/", "") | |
| require("plenary.reload").reload_module(dir) | |
| end |
| local pickers = require "telescope.pickers" | |
| local finders = require "telescope.finders" | |
| local previewers = require "telescope.previewers" | |
| local actions = require "telescope.actions" | |
| local action_state = require "telescope.actions.state" | |
| local conf = require("telescope.config").values | |
| local primeagen_execute = function(opts) |
| function RenameWithQuickfix() | |
| local position_params = vim.lsp.util.make_position_params() | |
| local new_name = vim.fn.input "New Name > " | |
| position_params.newName = new_name | |
| vim.lsp.buf_request(0, "textDocument/rename", position_params, function(err, method, result, ...) | |
| -- You can uncomment this to see what the result looks like. | |
| if false then | |
| print(vim.inspect(result)) |
| use mlua::Lua; | |
| use mlua::Result; | |
| fn main() -> Result<()> { | |
| println!("Hello, world!"); | |
| let lua = Lua::new(); | |
| { | |
| let mut rust_val = Vec::<i32>::new(); |
| function s:PerlSubstitute(line1, line2, sstring) | |
| let l:lines = getline(a:line1, a:line2) | |
| " Perl command with 'utf8' enabled | |
| " '#line 1' makes error messages prettier, displayed below: | |
| " Substitution replacement not terminated at PerlSubstitute line 1. | |
| let l:sysresult = systemlist("perl -e 'use utf8;' -e '#line 1 \"PerlSubstitute\"' -pe ". shellescape("s".escape(a:sstring,"%!").";"), l:lines) | |
| if v:shell_error | |
| echo l:sysresult | |
| return |
| local properties = { | |
| showing = { | |
| get = function(t) | |
| print("Yoooo we're showing.") | |
| return 5 | |
| end, | |
| set = function(t, v) | |
| error("This can't be ser.") |
| local Enum = function(tbl) | |
| return setmetatable(tbl, { | |
| __index = function(_, key) | |
| error(string.format("%s does not exist for this enum.", key)) | |
| end, | |
| __newindex = function(t, key, value) | |
| error("Enums are immutable. You are not able to set new values") | |
| end, | |
| }) |
| scores = { | |
| "!hate": -2, | |
| "!dislike": -1, | |
| "!like": 1, | |
| "!love": 2, | |
| } | |
| from collections import defaultdict | |
| counts = defaultdict(int) |
| local get_max_index = function(t) | |
| local max = 0 | |
| for k, v in pairs(t) do | |
| max = math.max(k, max) | |
| end | |
| return max | |
| end |
Comparisons taken from bram's reasoning for vim9
let start = reltime()
function VimNew()
let sum = 0
for i in range(1, 2999999)
let sum = sum + i
endfor