From 3e5cf001401d54fc16b7a5b3c409bf3beaa8f374 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Sun, 2 Oct 2011 11:20:06 +0200 Subject: [PATCH] scel: avoid temporary file for symbol table the symbol table can simply be passed via the command fifo, there is no need for using a temporary file. Signed-off-by: Tim Blechmann --- el/sclang-language.el | 17 ++--------------- sc/Emacs.sc | 9 +++------ 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/el/sclang-language.el b/el/sclang-language.el index 095f430..1a99e39 100644 --- a/el/sclang-language.el +++ b/el/sclang-language.el @@ -216,21 +216,8 @@ low-resource systems." 'symbolTable (lambda (arg) (when (and sclang-use-symbol-table arg) - (let ((file sclang-symbol-table-file)) - (when (and file (file-exists-p file)) - (with-current-buffer (get-buffer-create (sclang-make-buffer-name "SymbolTable" t)) - (erase-buffer) - (unwind-protect - (insert-file-contents file) - (delete-file file)) - (setq sclang-symbol-table-file nil) - (goto-char (point-min)) - (let ((table (condition-case nil - (read (current-buffer)) - (error nil)))) - (unless table (sclang-message "Couldn't retrieve symbol table.")) - (setq sclang-symbol-table (sort table 'string<)) - (sclang-update-font-lock)))))))) + (setq sclang-symbol-table (sort arg 'string<)) + (sclang-update-font-lock)))) (add-hook 'sclang-library-startup-hook (lambda () diff --git a/sc/Emacs.sc b/sc/Emacs.sc index 3087933..3a08bda 100644 --- a/sc/Emacs.sc +++ b/sc/Emacs.sc @@ -45,8 +45,7 @@ EmacsInterface { var result, dt; dt = { - result = IdentitySet.new; - + result = IdentitySet(16384); Class.allClasses.do { | class | if (class.isMetaClass.not) { result.add(class.name); @@ -56,14 +55,12 @@ EmacsInterface { }; }; - File.use(fileName, "w", { | file | - result.collectAs(_.asString, Array).storeLispOn(file); - }); + result = result.collectAs(_.asString, Array) }.bench(false); "Emacs: Built symbol table in % seconds\n".postf(dt.asStringPrec(3)); - true + result }) .put(\openDefinition, { | name | var class, method, res;