angch.venice.1.12.34.source-code.debug.venice Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of venice Show documentation
Show all versions of venice Show documentation
Venice, a sandboxed Lisp implemented in Java.
The newest version!
;;;; __ __ _
;;;; \ \ / /__ _ __ (_) ___ ___
;;;; \ \/ / _ \ '_ \| |/ __/ _ \
;;;; \ / __/ | | | | (_| __/
;;;; \/ \___|_| |_|_|\___\___|
;;;;
;;;;
;;;; Copyright 2017-2024 Venice
;;;;
;;;; Licensed under the Apache License, Version 2.0 (the "License");
;;;; you may not use this file except in compliance with the License.
;;;; You may obtain a copy of the License at
;;;;
;;;; http://www.apache.org/licenses/LICENSE-2.0
;;;;
;;;; Unless required by applicable law or agreed to in writing, software
;;;; distributed under the License is distributed on an "AS IS" BASIS,
;;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;;;; See the License for the specific language governing permissions and
;;;; limitations under the License.
;;;; Debugger demo
(do
(ns foo)
(defn wait [x] (sleep 300) (println x))
(defn async-wait [x]
(future (partial wait x)))
(defn calc [& x]
(let [a (first x) b (second x)]
(->> x
(filter even?)
(map #(* % 10)))))
(defn sum1 [x y]
(+ x y))
(defn sum2 [u v]
(sum1 (* 2 u) v))
(defn sum [s t]
(let [s (+ 2 s)]
(sum2 s t)))
(defn mul [x y]
(println "x" x)
(println "y" y)
(* x y))
(defn sum-future [x y]
(let [f (future (partial sum x y))]
(deref f))))