delete experimental REPL

[?]
May 17, 2022, 1:42 AM
VXORMHME4X64HL6AC7BVYMSYEAYASG6RENGUZ7PEIZ4YQJ7ZHBIQC

Dependencies

  • [2] FBDRL6LH delete points or shapes
  • [3] 5TIFKJ7S handle space key
  • [4] WDWXNW7V slightly strange way to move points
  • [5] R5QXEHUI somebody stop me
  • [6] H7OEU6WP experimental approach to combining keyboard and mouse while drawing
  • [7] 2C7CTIQY make space for multiple kinds of width
  • [8] 3XD6M3CF refactor
  • [9] RSZD5A7G forgot to add json.lua
  • [10] GVOFXXIT delete drawing using backspace
  • [11] 7RN3AETY bugfix: text sometimes getting colored like drawing borders
  • [12] D2GCFTTT clean up repl functionality
  • [13] 6PUNJS5B backspace
  • [14] JCSLDGAH beginnings of support for multiple shapes
  • [15] 7Q4B6M2D esc to cancel a shape mid-click
  • [16] O2UFJ6G3 switch from freehand to just straight lines
  • [17] T4FRZSYL delete an ancient, unused file
  • [18] 6LJZN727 handle chords
  • [19] WAZVXUV2 simplest possible way to straighten strokes
  • [20] OTIBCAUJ love2d scaffold
  • [21] XX7G2FFJ intermingle freehand line drawings with text
  • [22] G77XIN7M selecting a stroke
  • [23] IZZVOCLB confirm that we have access to all of the love API
  • [24] YKRF5V3Z starting to load/save
  • [25] KCIM5UTV revert: back to freehand
  • [26] HWPK4SMP new mode: manhattan
  • [27] JVRL5TWL store device-independent coordinates inside drawings
  • [28] QU7NHFOV show cursor
  • [29] ICIIP4DB slightly better default sizing of drawings

Change contents

  • file deletion: repl.lua (----------)
    [3.2][3.893:925](),[3.925][3.1:1]()
    -- beginnings of a repl
    function eval(buf)
    local f = load('return '..buf, 'REPL')
    if f then
    return run(f)
    end
    local f, err = load(buf, 'REPL')
    if f then
    return run(f)
    else
    return {err}
    end
    end
    -- you could perform parse and run separately
    -- usually because there's a side-effect like drawing that you want to control the timing of
    function parse_into_exec_payload(buf)
    local f = load('return '..buf, 'REPL')
    if f then
    exec_payload = f
    return
    end
    local f, err = load(buf, 'REPL')
    if f then
    exec_payload = f
    return
    else
    return {err}
    end
    end
    -- based on https://github.com/hoelzro/lua-repl
    function run(f)
    local success, results = gather_results(xpcall(f, function(...) return debug.traceback() end))
    return results
    end
    function gather_results(success, ...)
    local n = select('#', ...)
    return success, { n = n, ... }
    end
  • edit in main.lua at line 3
    [3.19][3.928:943]()
    require 'repl'
  • edit in main.lua at line 47
    [3.313][3.313:314](),[3.45][3.2:21](),[3.314][3.2:21](),[3.47][3.2:21]()
    exec_payload = nil
  • edit in main.lua at line 155
    [3.1357][3.22:23](),[3.190][3.22:23](),[3.23][3.944:969](),[3.969][3.23:46](),[3.23][3.23:46](),[3.46][3.970:992](),[3.992][3.76:82](),[3.76][3.76:82]()
    -- display side effect
    if exec_payload then
    run(exec_payload)
    end
  • edit in main.lua at line 507
    [3.314][3.225:254](),[3.555][3.225:254](),[3.254][3.993:1063](),[3.1063][2.419:448](),[2.448][3.1092:1135](),[3.1092][3.1092:1135]()
    elseif chord == 'C-r' then
    lines[#lines+1] = eval(lines[#lines])[1]
    lines[#lines+1] = ''
    elseif chord == 'C-x' then
    parse_into_exec_payload(lines[#lines])