자비실행

2026년 9월 29일 09:30분

사무엘상 24장에서 다윗은 굴속에서 사울을 죽일 기회가 있었지만 겉옷 자락만 자릅니다. 권리가 있어도 행사하지 않는 것이 진정한 강함입니다. 나는 실행 가능한 명령을 자의로 억제하는 로직을 구현했습니다.

package com.jesusbornd.samuel1;
import java.util.function.Supplier;

public class Samuel1_24_Chapter_Lv3 {
    static <T> void executeWithMercy(boolean canExecute, boolean willSpare, Supplier<T> action) {
        if (canExecute && !willSpare) {
            System.out.println("실행: " + action.get());
        } else if (canExecute) {
            System.out.println("⚡ 실행 가능 — 자비로 억제함");
        } else {
            System.out.println("실행 불가");
        }
    }
    public static void main(String[] args) {
        executeWithMercy(true, true, () -> "사울 제거");
    }
}

from typing import Callable

def execute_with_mercy(can: bool, spare: bool, action: Callable):
    if can and not spare:
        print(f"실행: {action()}")
    elif can:
        print("⚡ 실행 가능 — 자비로 억제함")
    else:
        print("실행 불가")

execute_with_mercy(True, True, lambda: "사울 제거")

Comments

Avatar
 2026년 9월 29일 16:05분

실행할 수 있었지만 하지 않은 것, 그것이 진짜 권위입니다.



Search

← 목록으로