Linux iad1-shared-b7-18 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
Apache
: 67.205.6.31 | : 216.73.216.47
Cant Read [ /etc/named.conf ]
8.2.29
fernandoquevedo
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
share /
guile /
3.0 /
language /
cps /
[ HOME SHELL ]
Name
Size
Permission
Action
closure-conversion.scm
37.26
KB
-rw-r--r--
compile-bytecode.scm
32.1
KB
-rw-r--r--
contification.scm
23.27
KB
-rw-r--r--
cse.scm
32.61
KB
-rw-r--r--
dce.scm
18.02
KB
-rw-r--r--
devirtualize-integers.scm
11.33
KB
-rw-r--r--
effects-analysis.scm
24.55
KB
-rw-r--r--
elide-arity-checks.scm
4.41
KB
-rw-r--r--
graphs.scm
10.16
KB
-rw-r--r--
intmap.scm
28.35
KB
-rw-r--r--
intset.scm
29.59
KB
-rw-r--r--
licm.scm
14.7
KB
-rw-r--r--
loop-instrumentation.scm
2.55
KB
-rw-r--r--
optimize.scm
5.6
KB
-rw-r--r--
peel-loops.scm
14.52
KB
-rw-r--r--
prune-top-level-scopes.scm
2.07
KB
-rw-r--r--
reify-primitives.scm
24.61
KB
-rw-r--r--
renumber.scm
10.21
KB
-rw-r--r--
rotate-loops.scm
10.44
KB
-rw-r--r--
self-references.scm
3.06
KB
-rw-r--r--
simplify.scm
10.52
KB
-rw-r--r--
slot-allocation.scm
40.87
KB
-rw-r--r--
spec.scm
1.83
KB
-rw-r--r--
specialize-numbers.scm
43.45
KB
-rw-r--r--
specialize-primcalls.scm
6.71
KB
-rw-r--r--
split-rec.scm
7.56
KB
-rw-r--r--
switch.scm
18.01
KB
-rw-r--r--
type-checks.scm
3.07
KB
-rw-r--r--
type-fold.scm
28.47
KB
-rw-r--r--
types.scm
80.57
KB
-rw-r--r--
utils.scm
13.68
KB
-rw-r--r--
verify.scm
12.41
KB
-rw-r--r--
with-cps.scm
5.72
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : with-cps.scm
;;; Continuation-passing style (CPS) intermediate language (IL) ;; Copyright (C) 2013, 2014, 2015 Free Software Foundation, Inc. ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public ;;;; License as published by the Free Software Foundation; either ;;;; version 3 of the License, or (at your option) any later version. ;;;; ;;;; This library is distributed in the hope that it will be useful, ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;;; Lesser General Public License for more details. ;;;; ;;;; You should have received a copy of the GNU Lesser General Public ;;;; License along with this library; if not, write to the Free Software ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ;;; Commentary: ;;; ;;; Guile's CPS language is a label->cont mapping, which seems simple ;;; enough. However it's often cumbersome to thread around the output ;;; CPS program when doing non-trivial transformations, or when building ;;; a CPS program from scratch. For example, when visiting an ;;; expression during CPS conversion, we usually already know the label ;;; and the $kargs wrapper for the cont, and just need to know the body ;;; of that cont. However when building the body of that possibly ;;; nested Tree-IL expression we will also need to add conts to the ;;; result, so really it's a process that takes an incoming program, ;;; adds conts to that program, and returns the result program and the ;;; result term. ;;; ;;; It's a bit treacherous to do in a functional style as once you start ;;; adding to a program, you shouldn't add to previous versions of that ;;; program. Getting that right in the context of this program seed ;;; that is threaded through the conversion requires the use of a ;;; pattern, with-cps. ;;; ;;; with-cps goes like this: ;;; ;;; (with-cps cps clause ... tail-clause) ;;; ;;; Valid clause kinds are: ;;; ;;; (letk LABEL CONT) ;;; (setk LABEL CONT) ;;; (letv VAR ...) ;;; (let$ X (PROC ARG ...)) ;;; ;;; letk and letv create fresh CPS labels and variable names, ;;; respectively. Labels and vars bound by letk and letv are in scope ;;; from their point of definition onward. letv just creates fresh ;;; variable names for use in other parts of with-cps, while letk binds ;;; fresh labels to values and adds them to the resulting program. The ;;; right-hand-side of letk, CONT, is passed to build-cont, so it should ;;; be a valid production of that language. setk is like letk but it ;;; doesn't create a fresh label name. ;;; ;;; let$ delegates processing to a sub-computation. The form (PROC ARG ;;; ...) is syntactically altered to be (PROC CPS ARG ...), where CPS is ;;; the value of the program being built, at that point in the ;;; left-to-right with-cps execution. That form is is expected to ;;; evaluate to two values: the new CPS term, and the value to bind to ;;; X. X is in scope for the following with-cps clauses. The name was ;;; chosen because the $ is reminiscent of the $ in CPS data types. ;;; ;;; The result of the with-cps form is determined by the tail clause, ;;; which may be of these kinds: ;;; ;;; ($ (PROC ARG ...)) ;;; (setk LABEL CONT) ;;; EXP ;;; ;;; $ is like let$, but in tail position. If the tail clause is setk, ;;; then only one value is returned, the resulting CPS program. ;;; Otherwise EXP is any kind of expression, which should not add to the ;;; resulting program. Ending the with-cps with EXP is equivalant to ;;; returning (values CPS EXP). ;;; ;;; It's a bit of a monad, innit? Don't tell anyone though! ;;; ;;; Sometimes you need to just bind some constants to CPS values. ;;; with-cps-constants is there for you. For example: ;;; ;;; (with-cps-constants cps ((foo 34)) ;;; (build-term ($values (foo)))) ;;; ;;; The body of with-cps-constants is a with-cps clause, or a sequence ;;; of such clauses. But usually you will want with-cps-constants ;;; inside a with-cps, so it usually looks like this: ;;; ;;; (with-cps cps ;;; ... ;;; ($ (with-cps-constants ((foo 34)) ;;; (build-term ($values (foo)))))) ;;; ;;; which is to say that the $ or the let$ adds the CPS argument for us. ;;; ;;; Code: (define-module (language cps with-cps) #:use-module (language cps) #:use-module (language cps utils) #:use-module (language cps intmap) #:export (with-cps with-cps-constants)) (define-syntax with-cps (syntax-rules (letk setk letv let$ $) ((_ (exp ...) clause ...) (let ((cps (exp ...))) (with-cps cps clause ...))) ((_ cps (letk label cont) clause ...) (let-fresh (label) () (with-cps (intmap-add! cps label (build-cont cont)) clause ...))) ((_ cps (setk label cont)) (intmap-add! cps label (build-cont cont) (lambda (old new) new))) ((_ cps (setk label cont) clause ...) (with-cps (with-cps cps (setk label cont)) clause ...)) ((_ cps (letv v ...) clause ...) (let-fresh () (v ...) (with-cps cps clause ...))) ((_ cps (let$ var (proc arg ...)) clause ...) (call-with-values (lambda () (proc cps arg ...)) (lambda (cps var) (with-cps cps clause ...)))) ((_ cps ($ (proc arg ...))) (proc cps arg ...)) ((_ cps exp) (values cps exp)))) (define-syntax with-cps-constants (syntax-rules () ((_ cps () clause ...) (with-cps cps clause ...)) ((_ cps ((var val) (var* val*) ...) clause ...) (let ((x val)) (with-cps cps (letv var) (let$ body (with-cps-constants ((var* val*) ...) clause ...)) (letk label ($kargs ('var) (var) ,body)) (build-term ($continue label #f ($const x))))))))
Close