Skip to content

Instantly share code, notes, and snippets.

View damien-mattei's full-sized avatar

Damien MATTEI damien-mattei

View GitHub Profile
@damien-mattei
damien-mattei / interpole_fields+.rkt
Created March 24, 2025 10:41
generating image and web page in Racket/scheme with infix notation and scheme+ library
#! /usr/bin/env racket
#lang reader SRFI-105
(require Scheme+)
(require setup/dirs)
(require racket/date)
(require srfi/13) ; for at least string-contains
(require upi/basename)
`
(pretty-print (syntax->datum (expand '($nfx$
data-xml
<-
(for/list
((one-data-row data-interpol) (one-trajectory-row data-trajectory))
($nfx$
(index X_MSO Y_MSO Z_MSO VALx VALy VALz)
<-
(apply values (string-split one-data-row)))
#! /usr/bin/env racket
;;#lang racket
;; Copyright (C) 2012 David A. Wheeler and Alan Manuel K. Gloria. All Rights Reserved.
;; Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
;; The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
@damien-mattei
damien-mattei / infix->prefix.scm
Last active March 24, 2025 10:44
infix to prefix in scheme
;; for optimisation routines in parsing
;; guile version
;;; evaluates `terms` symbolically or numerically as a basic infix expression
(define (!0-generic terms operator-precedence creator)
(display "!0-generic : terms=") (display terms) (newline)
;;(display "!0-generic : operator-precedence=") (display operator-precedence) (newline)