string-to-symbol

SAS IML use of Mattrib with Macro (symget) in a loop

淺唱寂寞╮ 提交于 2020-01-17 08:22:07
问题 In an IML proc I have several martices and several vectors with the names of columns: proc IML; mydata1 = {1 2 3, 2 3 4}; mydata2 = {1 2, 2 3}; names1 = {'red' 'green' 'blue'}; names2 = {'black' 'white'}; To assign column names to columns in matrices one can copypaste the mattrib statement enough times: /* mattrib mydata1 colname=names1;*/ /* mattrib mydata2 colname=names2;*/ However, in my case the number of matrices is defined at execution, thus a do loop is needed. The following code

SAS IML use of Mattrib with Macro (symget) in a loop

会有一股神秘感。 提交于 2020-01-17 08:22:06
问题 In an IML proc I have several martices and several vectors with the names of columns: proc IML; mydata1 = {1 2 3, 2 3 4}; mydata2 = {1 2, 2 3}; names1 = {'red' 'green' 'blue'}; names2 = {'black' 'white'}; To assign column names to columns in matrices one can copypaste the mattrib statement enough times: /* mattrib mydata1 colname=names1;*/ /* mattrib mydata2 colname=names2;*/ However, in my case the number of matrices is defined at execution, thus a do loop is needed. The following code

SAS IML use of Mattrib with Macro (symget) in a loop

独自空忆成欢 提交于 2020-01-17 08:22:06
问题 In an IML proc I have several martices and several vectors with the names of columns: proc IML; mydata1 = {1 2 3, 2 3 4}; mydata2 = {1 2, 2 3}; names1 = {'red' 'green' 'blue'}; names2 = {'black' 'white'}; To assign column names to columns in matrices one can copypaste the mattrib statement enough times: /* mattrib mydata1 colname=names1;*/ /* mattrib mydata2 colname=names2;*/ However, in my case the number of matrices is defined at execution, thus a do loop is needed. The following code

String to symbols and numbers [duplicate]

佐手、 提交于 2019-12-25 18:36:45
问题 This question already has answers here : How to mathematically evaluate a string like “2-1” to produce “1”? (8 answers) Closed 4 years ago . Is there a way to turn the addition, subtraction, multiplication, and division symbols in a string to actual addition, subtraction, multiplication, and division symbols, along with the numbers inside the string to actual numbers? So, instead of the symbols acting as part of the string, they would act as they would outside of the string, and same thing

How to get a property from a plist

五迷三道 提交于 2019-12-11 02:45:49
问题 I am a newbie in Lisp. I want to access a particular property from a property list with a string variable like this (setf sym (list :p1 1)) (setf x "p1") (getf sym :x) 回答1: About cl:getf Let Petit Prince's answer is right that getf is probably the function you want to use here, but note that it can be used for more than just keyword symbols. You can use it for any objects. A property list is just a list of alternating indicators and values, and any object can be an indicator: (let ((plist