⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tone

📁 A very small LISP implementation with several packages and demo programs.
💻
字号:
#!bin/picolisp lib.l# 13oct06abu# (c) Software Lab. Alexander Burger# Must be run on a virtual console(load "lib/misc.l" "lib/gcc.l")### 'ioctl' glue function(gcc "tst" NIL 'tone)#include <sys/ioctl.h>#include <linux/kd.h> // KIOCSOUND// (tone 'freq) -> flgany tone(any ex) {   long amp = evCnt(ex,cdr(ex));   long freq = evCnt(ex,cddr(ex));   return ioctl(0, KIOCSOUND, amp==0 || freq==0? 0 : 1193180L/freq) < 0? Nil : T;}/**/### Create named pipe(unless (call 'test "-p" "fifo/tone")   (call 'mkdir "-p" "fifo")   (call 'mkfifo "fifo/tone") )(push1 '*Bye '(call 'rm "fifo/tone"))### Serve calls like:#  (setq *Tone (open "fifo/tone"))#  (out *Tone (pr 100 440))  # 440 Hz#  (out *Tone (pr 0 0))    # Off#  (close *Tone)(loop   (in "fifo/tone"      (while (rd)         (tone @ (rd)) ) ) )

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -