#!/usr/bin/env ruby flo = [ "dividuum", "syb", "fiji", "flowhase" ] # flos sind keine arrayss1! for i in 0..3 eval "flo#{i} = flo[#{i}]" puts "flo#{i} == \"" + eval("flo#{i}") + "\"" end
Dieses Perl (*duck*) kann ja keiner lesen!
(eval-when (:compile-toplevel :load-toplevel :execute) (defvar *flo-sequence* #("dividuum" "syb" "fiji" "flowhase"))) (defmacro make-individual-flo-variables () (cons 'progn (loop for flo across *flo-sequence* for i from 0 collect `(defvar ,(read-from-string (format nil "*flo~d*" i)) ,flo)))) (make-individual-flo-variables) (dotimes (i 4) (format t "~&flo~d = ~a" i (eval (read-from-string (format nil "*flo~d*" i)))))