#clj compilation
Explore tagged Tumblr posts
aceinthetrap · 11 months ago
Text
Happy 2nd anniversary, LBFAD!
Tumblr media Tumblr media Tumblr media Tumblr media
weibo
64 notes · View notes
gima326 · 9 months ago
Text
ClojureScript 再訪。
挙動の見えなさ、その不安定さに困惑しきり…。
まえにやってたときに(…わおう、4年まえぇ!?)、「.cljs から呼び出す .clj は通常の関���ではなく、マクロしか呼び出せないらしい」ということは経験的に得た感触だったけれど、じゃあ、そのマクロを介して、既存の(通常の)関数を呼び出せるんじゃないか、と思って七転八倒してました。 …まぁ、実現できたんだけど、バグを突いたようなその感触に、なんだかな、と首をかしげているところ。
//====================================
;; proto/ ;; ├─ out/ ;; ├─ src/ ;; │ └─ proto/ ;; │    ├─ clj/ ;; │    │  ├─ aiueo.clj       [ fnc(s) ] ;; │    │  └─ kakikukeko.clj    [ macro(s) ] ;; │    └─ cljs/ ;; │       ├─ sashisuseso.cljs  [ require-macros ] ;; │       └─ core.cljs ;; │ ;; └─ cljs.jar
====================================
■ cljs.jar [ https://github.com/clojure/clojurescript/releases/download/r1.11.132/cljs.jar ]よりダウンロードしたもの ==================================== ■ aiueo.clj (ns proto.clj.aiueo)
(defn fnc1 [] "fnc1") (defn fnc2 [] "fnc2") ====================================
■ kakikukeko.clj (ns proto.clj.kakikukeko  (:require [proto.clj.aiueo :as a])) (defmacro macro1 [] "macro1") (defmacro macro2 [] (a/fnc2)) ==================================== ■ sashisuseso.cljs (ns proto.cljs.sashisuseso  ;; ①  ;; (:require-macros [proto.clj.kakikukeko :as k]) )
(defn fnc3 []  (do   (println    (str     ;; ②     ;; (k/macro1) " "     ;; ③     ;; (k/macro2)     " aaa" " bbb" " ccc" " ddd") ))) ==================================== ■ REPL 起動 $ java -cp "cljs.jar:src" cljs.main --compile proto.cljs.core --repl ==================================== ■変更を反映するコマンド ;; ④ cljs.user=> (require-macros '[proto.clj.kakikukeko :as k] :reload) cljs.user=> (require '[proto.cljs.sashisuseso :as s] :reload) cljs.user=> (require '[proto.cljs.core :as t] :reload)
====================================// ・「aiueo.clj」の内容は、REPL 起動時にのみ感知されるみたい。 ・「sashisuseso.cljs」のコメントアウト部分③は、マクロ経由で関数を呼び出している箇所だ。 ・REPL の初回起動時にエラーが出るようなら、コメントアウト部分①、②が実行されないようにするところから、足がかりを作る。とくに「③」が活きていると、確実にビルドエラーになるみたい。 ・REPL が起動できたら、上記「④」のコマンドを実行して、(aiueo.clj を require している状態の)kakikukeko.clj の内容を反映させる。 ・そのあとで、「macro2」を呼び出して、「fnc2」から値が取得できることを確認するが、その際、:as のエイリアスではなく、以下のコマンドのように、��ッケージのフルパス指定で実行する。 cljs.user=> (proto.clj.kakikukeko/macro2) "fnc2"
0 notes
holyjak · 1 year ago
Text
A useful reminder about the largely unknown power and potential usefulness of URI templates. "URI Template supports more sophisticated features, such as embedding lists and maps ...".
Also, the mentioned Reap library "for decoding and encoding strings used by web protocols," seems useful. It uses parser combinators and basic "parsing expression grammers" to make translating the grammar from a standard trivial, and exposes rfc<num>.clj with high-level fns, such as compile-uri-template and make-uri / match-uri.
0 notes
a-shoebox-named-meap · 2 years ago
Text
a guide to people’s names, titles, and other forms of address in cang lan jue/love between fairy and devil
so for chinese media, i like knowing how to read and pronounce the characters’ names, but when trying to look up the names of the clj/lbfad people, i found the info i wanted rather hard to find. i wanted to know what characters made up their names! how to pronounce them! what their different titles and nicknames meant and what kind of people address them by those names! so i decided to try compiling this info myself, on a whim. it’s taken a HOT minute, and a Lot of scrubbing through the episodes, and it will probably need to be updated and edited as i go about rewatching the show (and improving my chinese :’) aha) but here’s what i got for now! feel free to message me if you have suggestions, edits, corrections, or requests :) hopefully some people find this helpful or interesting – i know some of the things i’ve included here are lost in translation in netflix’s english subtitles.
disclaimer of sorts: for definitions, i used MDBG (mdbg.net) and the Pleco app. also, i’m a native english speaker who’s been learning chinese for a handful of years; my chinese is so-so and i tend to miss things like Connotations™. i’ve watched the show 2.5 times and read 1 page of the book. i did my best :P again, open to suggestions! please be sure to check this source post for the most updated version, as i imagine i’ll be making edits now and again.
this is in no particular order. for each person, i put their official/most commonly used name at the top, then in bullets beneath that i’ve listed definitions for the individual characters in their name, along with any other titles or nicknames that they have been called in the show. any somewhat extraneous information is in italics.
苍兰诀 Cāng Lán Jué
the title of the show and the original novel; 苍 (cāng) refers to Dongfang Qingcang, 兰 (lán) refers to Xiao Lanhua, and 诀 (jué) means “farewell.” i’ve seen some people translate this as the Parting of the Fairy and Devil. (i discovered this halfway through watching the show and it made me SO nervous for how the show would end)
九鹭非香 (Jiǔ Lù Fēi Xiāng) is the author’s name/pseudonym.
东方青苍 Dōngfāng Qīngcāng
character breakdown: 东方 (dōngfāng) = east, eastern. 青 (qīng) = green, sometimes blue or black (or blue-green), young/youth. 苍 (cāng) = dark blue, deep green, ash-gray.
my hypothesized derivation of his name: while i was researching the Black Tortoise (玄武 Xuánwǔ) for this post, I Discovered Something Rather Important. there are four mythological creatures that symbolize the chinese constellations and four cardinal directions. besides the Black Tortoise, there are the White Tiger (白虎 Báihǔ), Vermillion Bird (朱雀 Zhūquè), and the Azure Dragon (青龙 Qīnglóng). the Azure Dragon represents the east. so get this: its epithet is the Azure Dragon of the East. in chinese it is called 东方青龙 (Dōngfāng Qīnglóng) or 东方苍龙 (Dōngfāng Cānglóng). SOUND FAMILIAR?? ISN’T THAT COOL?? i just think that is so cool. yes, the characters are the same as in Dongfang Qingcang’s name. associated with the Azure Dragon are: East (direction), Spring (season), Dawn (time of day), Blue/green (color), and Wood (chinese element). my mind imploded when i discovered this, have a good day.
大魔头 dà mótóu: (used in the book, changed to “da mutou” in the show for reasons? some folks mentioned they might have been censoring “mo”) lit. translates to big devil head/boss/chief, big demon boss
大木头 dà mùtóu: (phonetically similar to da motou, changed to this in the show for Reasons™) lit. big wooden head, big wooden chief/boss, or big log. it can also be translated as big blockhead, as per the netflix engsubs, but it’s not my personal preference — the connotations and intent between “da mutou” and “Big Blockhead” feel very different to me. (i.e., if you’re writing dialogue in a fic, i would recommend Da Mutou over Big Blockhead.) Xiao Lanhua calls him this, saying that it sounds a bit less serious than other, more formal forms of address for him.
东方强 Dōngfāng Qiáng, 大强 Dà Qiáng: the name and familiar nickname Xiao Lanhua calls him in the early days before she knew his identity, after she misheard him saying his actual name; 大 (dà) = big, 强 (qiáng) = strong, powerful
本座 běnzuò: a term used to refer to oneself, like “i/me,” but specifically if that person is very high-ranking; your average person wouldn’t use this word. (the usual word for i/me is 我 wǒ. near the end of the show Dongfang Qingcang transitions to using 我 wǒ with Xiao Lanhua — it’s a notable switch that gets lost in translation! similarly, he also makes the switch during his heated tirade at his father in ep. 18, and switches back to his usual 本座 (běnzuò) after he momentarily collects himself. i could be wrong, but i think he drops the 本座 (běnzuò) when less formality or authority is required or desired, like when Things Get Personal, or when he’s stepping out of his role as Moon Supreme, so to speak.)
尊上 zūnshàng: “my lord,” by far the most common term used to address and refer to Dongfang Qingcang by a majority of characters who aren’t his enemy. also part of the phrase often used to formally greet Dongfang Qingcang, “拜见尊上!” (bàijiàn zūnshàng) “Greetings, my lord!”
月尊 yuèzūn: Moon Supreme, used to refer to Dongfang Qingcang or this position (as in the throne, the seat of the Moon Supreme, the name of this Job) respectfully
月尊大人 yuèzūn dàren: Moon Supreme Lord (netflix); 大人 (dàren) is a title of respect towards one’s superior. this title is often used to address Dongfang Qingcang directly. Xiao Lanhua uses it regularly when she is being kept in the Moon Palace, both in private conversation and in serious public settings. (as the show goes on, she switches to 大木头 (dà mùtóu) in their more private, casual conversations but maintains 月尊大人 (yuèzūn dàren) in situations that warrant greater respect and formality.)
魔尊 mózūn: devil king, demon king; used in the book to address him at times (by Lady Chidi for instance, who in the show calls him 月尊 (yuèzūn), Moon Supreme; were they trying to avoid the word 魔 mó in the show or something, i don’t know)
儿子 érzi, 孩子 háizi: “son/my son” and “child/my child,” respectively. used briefly by Dongfang Qingcang’s father to address his son directly. the other times, he calls him Qingcang.
兄尊 xiōngzūn: a specific form of “brother”; the word that Xunfeng uses to address and refer to Dongfang Qingcang (excluding one case when Xunfeng uses 月尊 (yuèzūn), during a heated argument about the Chengying sword). 兄 (xiōng) = older brother (i.e., only a younger sibling would use this term), 尊 (zūn) = a respectful honorific often appended to these titles, usually signifying high, venerated status. 尊 (zūn) comes up a lot :)
for those who are curious about the reverse: Dongfang Qingcang usually addresses Xunfeng by name. when Dongfang Qingcang refers to Xunfeng with a familial term in ep. 2, he says “我那弟弟,” my younger brother (possibly translated as “that younger brother of mine”). for “younger brother” he uses 弟弟 dìdi, there’s no 尊 (zūn) or other honorific — probably because his younger brother is lower than him in status, so there is no need for an honorific. (it’s also interesting to see that he dropped the 本座 (běnzuò) for this line and used 我 (wǒ), but i’m not sure yet if this implies anything, if it might be a mistake, or if it just sounds more natural. in ep. 10, Dongfang Qingcang calls Xunfeng “本座的同胞弟弟,” “my younger brother (borne of the same parents),” where he does use běnzuò to refer to himself, but this line is a bit sarcastic in tone.)
both Dongfang Qingcang and Xunfeng refer to and address their father with 父尊 fùzūn, which is father + honorific, similar to 兄尊 (xiōngzūn). others usually call their father the previous/former/old Moon Supreme, 老月尊 lǎo yuèzūn. (extra note: Dongfang Qingcang doesn’t use 父尊 (fūzūn) in every case where he is referring to his father — on a rare few occasions he uses the more generic term 父亲 (fùqīn) — but based on my Research and consulting a few people with better chinese than me, this may be because of the way the word “father” is used in the sentence. more of a grammar/syntax thing than something significant to the plot or his character.)
a neat thing that happened in ep. 21, around timestamp 38:15: Dongfang Qingcang accidentally uses 父尊 (fùzūn) when talking about his father to Xiao Run in the mortal realm, which might have implied to Xiao Run that his father is of very high, emperor-like status (very sus, for an undercover agent); however, he catches himself, and switches to 父亲 fùqīn, which is the more common term for “father.” in the engsubs it just looks like he’s stuttering over the word “father.” 父亲 (fùqīn) is also used in modern day to refer to one’s father, but it’s a bit formal and usually used in conversation with other people or in writing; you wouldn’t use this term to address your dad directly, that’s 爸爸 bàba. in case any modern AU fic writers were wondering ¯\_(ツ)_/¯
少尊 shàozūn: Young Lord. used to address Dongfang Qingcang when he was a boy, when his father was still the Moon Supreme.
属下 shǔxià: subordinate. used to refer to himself (in 3rd person) when speaking to Xiyun, when he was acting as her servant after her rebirth. (this term is also used by Shangque with Dongfang Qingcang.)
小仙 xiǎoxiān: lit. little immortal, perhaps translated as low/lower immortal. this isn’t so much a title as a description of his position, when he is pretending to be from Shuiyuntian in front of Xiyun. this scene helped me understand how the word 仙 (xiān) works, actually. Dongfang Qingcang called himself a 小仙 (xiǎoxiān) of Shuiyuntian, to which Xiyun later said, “你身上没有仙气。根本不是仙族。” netflix engsubs wrote, “You have no immortal aura on you. You are not immortal.” and then i thought to myself, but he is immortal though, isn’t he? but 仙 (xiān), meaning “immortal” or “celestial being,” refers more to the race of people in Shuiyuntian rather than the state of immortality. immortal the noun, not immortal the adjective. Xiyun isn’t saying, “you are not an undying entity,” (because he is); what she really means is, “you are not of the fairy realm/tribe.” 仙族 (xiānzú), the term she uses in this sentence, means fairy tribe or immortal realm, referring to Shuiyuntian.
东方员外 Dōngfāng yuánwài: translated as “Mr. Dongfang” by netflix. this is the mortal title Jieli assigned to him, and how he is usually addressed during the mortal realm arc. 员外 (yuánwài) is an old word meaning “counselor” or “landlord.” Jieli intended for him to be a wealthy businessman. when he is just addressed as 员外 (yuánwài), it is translated to “sir.”
东方兄 Dōngfāng-xiōng: 兄 (xiōng) refers to one’s older brother; this is a familiar term Xiao Run uses to address Dongfang Qingcang when they become Bros™
内兄 (nèixiōng): brother-in-law, wife’s elder brother. Xiao Run calls Dongfang Qingcang this, after Jieli announces that Xiao Lanhua is Dongfang Qingcang’s sister.
郎君 lángjūn: translated by netflix as “young man” and “sir.” it is also an archaic form of addressing one’s husband, and could refer to the playboy of a rich family. however, i think in this show it is a respectful form of address, possibly directed at the head of a household unit (Xiao Run’s father and occasionally Xiao Run himself are referred to with the same term). i’m unsure though.
小兰花 Xiǎo Lánhuā (Orchid)
character breakdown: 小 (xiǎo) = little/small, but commonly used in front of names and nicknames for ... reasons i am too lazy to explain here, but other people have definitely written about it if you’d like to look it up. 兰花 (lánhuā) = orchid.
小花妖 Xiǎo Huāyāo: lit. little flower demon, little flower monster; the name that Dongfang Qingcang initially calls Xiao Lanhua, when he still doesn’t like her. netflix subs say “little flower spirit,” but to me this phrase loses a bit of the evil/demon/monster connotation — i feel like Xiao Huayao is not meant to be particularly respectful or polite :’) interestingly, i noticed in ep. 10 that Shangque calls her 小花妖 (Xiǎo Huāyāo) to her face, perhaps because she was annoying him, but he calls her Xiao Lanhua (Orchid) in his private conversation with Dongfang Qingcang shortly after. forms of address really have so many potential implications…
兰花仙子 Lánhuā xiānzi: Fairy Orchid; she is sometimes addressed as just 仙子 (xiānzi), “fairy,” including in situations where her name is not known by the speaker
仙族女人 Xiānzú nǚrén: Fairy Tribe woman (used by some Moon Tribe people to address her in third person, not when speaking to her directly)
月主 yuèzhǔ: translated as Moon Queen; zhǔ on its own means host, owner, or master. this is how people of the Moon Tribe address Xiao Lanhua after she undergoes her trip to Non-Abidance Cave to marry Dongfang Qingcang.
息芸 Xīyún: her name as the goddess. 息 (xī) = breath, or to cease/stop/rest; 芸 (yún) mainly refers to the plant Ruta graveolens, the common rue, as far as i can tell
息山神女 Xīshān shénnǚ: Goddess of Xishan; 山 (shān) = mountain
息兰(族的)神女 Xīlán (zú de) shénnǚ: Xilan Goddess (without parentheses) or Goddess of the Xilan Tribe (with parentheses, used by Xiao Lanhua at one point to refer to herself). Goddess of Xishan is the more common title, compared to Xilan Goddess, but both have been used.
breakdown of previous: 息兰 (xīlán) = the name of the tribe, containing the words for “breath” and “orchid”; 族 (zú) = the word for tribe, clan, race, nationality, ethnicity, etc.; 的 (de) is a possessive particle; 神女 (shénnǚ) = goddess (lit. god-woman; it’s also slang for “prostitute” but that doesn’t come up in this show)
故人 gùrén: old friend (literary); how the Xuanwu god addresses Xiao Lanhua/Xiyun. (this word is also used to refer to the deceased/departed, but not in this context.)
when referring to Xiao Lanhua’s plant form, people in the show use (小) 兰花草, (xiǎo) lánhuā cǎo. 草 (cǎo) = grass. it means (little) orchid plant. not every mention includes the “little.”
姑奶奶 gū ​nǎi​nai: lit. paternal great aunt, but has a few other colloquial uses, including “form of address for an unmarried girl or woman, expressing affection or reproach,” which seems to be how Jieli uses it in ep. 19 when pleading with Xiao Lanhua to stop freezing herself in the cave. (“姑奶奶,我求求你了!” “Gu nainai, I'm begging you!”)
her familial relationship to Xunfeng: in ep. 28 Dongfang Qingcang says, “If you still regard me as your brother, then she is your sister-in-law.” 她就是你的阿嫂。阿嫂 (ā-sǎo) is an archaic term for sister-in-law, specifically for one’s older brother’s wife. if Dongfang Qingcang and Xiao Lanhua were married, Xunfeng might call her this, but this never happens in the show. Xie Wanqing, similarly, also refers to Xiao Lanhua as her future 阿嫂 (ā-sǎo). in a modern AU, Xunfeng would call his sister-in-law either 嫂子 (sǎozi) or 大嫂 (dàsǎo). my mom is a native speaker and says the latter is more likely. it refers to the oldest brother’s wife, the “big” sister-in-law, even if she is younger than the speaker.
on that note, the word for “wife” is 妻子 (qīzi), and it’s sometimes used in the show when referring to Xiao Lanhua per her relationship to Dongfang Qingcang. Dongfang Qingcang himself often uses 月主 (yuèzhǔ), Moon Queen, in lieu of “wife.” a couple exceptions: when he’s pretending Xiao Lanhua is his wife to trick Xiao Run, the word he uses for “wife” is 内子 (nèizǐ). when he’s speaking to Changheng in his dream state, he does use 妻子 (qīzi) to refer to her as his wife.
兰花娘子 Lánhuā niángzǐ: Lady Orchid. commonly used to address Xiao Lanhua in the mortal realm. 娘子 (niángzǐ) is a polite form of address for a young woman, at least in Ye Olde Days™; it can also be used to address one’s wife, which Dongfang Qingcang does when he’s pretending that Xiao Lanhua is his wife to trick Xiao Run. there, 娘子 (niángzǐ) is translated as “honey.”
女侠 nǚxiá: heroine, lit. woman-hero; 侠 (xiá) can mean chivalrous, brave, heroic. this is how Xiao Run calls her when he first meets her, thinking she’s The One.
画中仙 (子) huàzhōng xiān(zi): fairy in the painting. Xiao Run calls her this early on after meeting her, and whenever he refers to the fairy in his dreams.
月尊副将 觞阙 Yuèzūn fùjiàng Shāngquè (Moon Supreme’s lieutenant, Shangque)
character breakdown: 副将 (fùjiāng) = deputy general, translated by netflix as “lieutenant.” 觞 (shāng) = a wine cup or goblet, or to propose a toast. 阙 (què) = an archaic term for the watchtowers on either side of an (imperial) palace gate.
Dongfang Qingcang, Xiao Lanhua (later), and Xunfeng address Shangque by just his name. Jieli later refers to Shangque by name but addresses him with “stupid black dragon,” usually.
黑龙大哥 hēilóng dàgē: lit. black dragon big brother, translated by netflix as just “Black Dragon.” used by Xiao Lanhua and Jieli to address Shangque, at least in the earlier stages of knowing him — Xiao Lanhua eventually just calls him Shangque, and Jieli switches to “stupid black dragon.” 黑龙大哥 (hēilóng dàgē) is still a respectful form of address, but the appended 大哥 (dàgē) gives a bit of familiarity to it that i feel like “Black Dragon” alone doesn’t quite convey. (Jieli calls him this name as soon as she meets him. my guess is that she is trying to sound close to him, as a ploy to appeal to familiarity in order to persuade him not to throw her in prison.)
觞阙哥哥 Shāngquè gēge: 哥哥 (gēge) means “older brother,” but is often used to address a man or boy (of no blood relation) in a very familiar way. Jieli calls him this at least once in the show, when she’s trying to be cute and wheedle a favor out of him.
觞阙大人 Shāngquè dàren: Lord Shangque (大人 (dàren) is a title of respect toward one’s superior). palace staff address Shangque with this.
蠢黑龙 chǔn hēilóng: stupid black dragon. this is the affectionate insult Jieli uses to address Shangque. 蠢 (chǔn) means stupid, foolish, clumsy, or dull.
属下 shǔxià: subordinate. used by Shangque to refer to himself (in third person) when speaking to Dongfang Qingcang.
将军 jiāngjūn: general. the palace doctor calls Shangque this. it’s odd to me because Shangque was first introduced as “deputy general/lieutenant” — i’m not sure which is more accurate for the name of his position. unless Shangque got a mid-show promotion when i wasn’t looking.
结黎 Jiēlí
character breakdown: 结 (jiē) = (of a plant) to produce fruit; alt. pronunciation jié means to tie, knot, connect, bind. 黎 (lí) = many, multitude; (literary) black, dark; a surname; the Li ethnic group.
掌柜的 zhǎngguìde: shopkeeper, manager of a store. netflix translated this as “Miss” when the delivery man addresses Jieli in ep. 2.
长珩战神 Chánghéng zhànshén (God of War, Changheng)
character breakdown: 长 (cháng) = long or length; always, forever, constantly (not to be confused with zhǎng, an alternate pronunciation of the same character, with a different meaning). 珩 (héng) = an archaic term for the “top gem of a girdle-pendant (as worn by aristocrats and high officials)” (thank you, Pleco). 战 (zhàn) = war, battle, fight. 神 (shén) = god, immortal. 战神 (zhànshén) is his God of War title, and Lady Chidi’s as well.
长珩仙君 Chánghéng xiānjūn: Lord Changheng. fairies call him this, and he is often directly addressed just as 仙君 (xiānjūn) mid-conversation. 仙君 (xiānjūn) lit. means immortal ruler, as a title it’s usually translated to “Lord/my lord” or similar.
Supreme Liyuan and Master Sansheng call him 长珩战神 (Chánghéng zhànshén), in the first episode.
罪仙长珩 zuìxiān Chánghéng: immortal criminal Changheng :(
萧润 Xiāo Rùn: Changheng’s name in the mortal realm arc. 萧 (xiāo) is a surname, and a word that means miserable, desolate, or dreary. 润 (rùn) means moist, sleek; to embellish or enhance; or profit, remuneration.
润郎 Rùn-láng: the friendly name by which Qu Shui addresses Xiao Run, and by which Dongfang Qingcang also addresses Xiao Run when they are being Bros™. (however, when referring to Xiao Run privately, Dongfang Qingcang just calls him Xiao Run.)
萧家二郎 Xiāojiā èrláng: translated by netflix as Mr. Xiao, used to refer to Xiao Run when his gifts were formally presented to Lady Wanqing. i might translate this as “the second child/son of the Xiao family,” but to be honest, the definitions i’ve found for 郎 (láng) are a little hazy to me. i could be wrong. but Xiao Run does have an older brother, who is referred to as 萧家大郎 (Xiāojiā dàláng), which i would translate as “the eldest young master of the Xiao family.” Xiao Run’s father, similar to Dongfang Qingcang, is referring to as 萧家郎君 (Xiāojiā lángjūn), which is translated to “Master,” presumably as the head of house.
萧家郎君 Xiāojiā lángjūn: and on that note, Xiao Run is also addressed as 郎君 (lángjūn)! not often, but on at least a couple occasions, such as by Lady Wanqing and Xiao Lanhua. this form of address is still translated by netflix as Mr. Xiao. again, in other situations Xiao Run is referred to as 二郎 (èrláng), and his father is referred to as 郎君 (lángjūn). i honestly don’t know how the word 郎 (láng) works at this point.
萧公子 Xiāo-gōngzi: also translated as Mr. Xiao. could also be “Young Master Xiao.” used to address him directly.
丹音仙子 Dānyīn xiānzi (Fairy Danyin)
character breakdown: 丹 (dān) = cinnabar, red, powder. 音 (yīn) = sound, musical note, tone, noise.
曲水 Qū Shuǐ: Danyin’s name in the mortal realm arc. 曲 (qū) is a surname, and a word that means bend/to bend. 水 (shuǐ) = water.
蛐蛐儿 Qūqu-ér/Qūqur: it means Cricket, and it contains a homonym for the first character of Qu Shui’s name. this is Xiao Run’s familiar nickname for Qu Shui.
容昊仙君 Rónghào xiānjūn (Lord Ronghao)
character breakdown: 容 (róng) = to hold, contain, allow, tolerate; appearance, look, or countenance. 昊 (hào) = vast, limitless; the vast sky. interesting potential interpretations for his name! (both also happen to be surnames on their own.)
仙君 xiānjūn: Lord, my Lord, in his case. this is how the fairies address him.
阿昊 Ā-Hào: what Lady Chidi calls him. 阿 (ā) is placed as a prefix before monosyllabic names or kinship terms to indicate familiarity; this form of address shows that Lady Chidi is close with her apprentice.
孽徒 niètú: treacherous/traitorous apprentice. Lady Chidi refers to Ronghao with this when she turns the both of them in in ep. 32.
海市主 Hǎishì zhǔ: Lord of Haishi; same 主 (zhǔ) as in 月主 (yuèzhǔ), Moon Queen, meaning “host” or “master”
主上 zhǔshàng: Lord, my lord, the lord. this is how he is addressed and referred to in his Lord of Haishi persona, such as by Dieyi and other Haishi underlings.
海市 (Hǎishì) is made up of the words for “sea/ocean” and “city”; together, they mean “mirage.”
also the 昊 (hào) in 容昊 (Rónghào) is the same as the 昊 (hào) in Haotian Tower, where Dongfang Qingcang was imprisoned. 昊天塔 (Hàotiāntǎ). “the vast, limitless sky” would be my translation of Haotian.
战神 赤地女子 zhànshén Chìdì nǚzǐ (God of War, Lady Chidi)
character breakdown: 赤地 (chìdì) = barren land. there’s an idiom that goes 赤地千里 (chìdì qiānlǐ), meaning “a thousand li of barren land — a scene of utter desolation (after a drought or insect plague)” (copied from Pleco). this definition reminds me of the Xuanxu Realm. hmm … thoughts for later. anyway, 女子 (nǚzǐ) = woman, female.
i’ve seen some translations of her name as “Chidi Woman” but i much prefer “Lady Chidi”
师父 shīfu: Master. this is how Ronghao addresses her (same as Xiao Lanhua towards Master Arbiter Siming).
谢惋卿 Xiè Wǎnqīng: Lady Chidi’s name during the mortal realm arc. 谢 (xiè) is a surname, and also means “to thank,” or sometimes “to apologize.” 惋 (wǎn) is a sigh, or to heave a sigh. 卿 (qīng) has several archaic meanings: high-ranking official, term of endearment between spouses, term used by the emperor for his subjects, or an honorific. (oh, where would i be without my dictionaries…)
惋卿娘子 Wǎnqīng niángzǐ: Lady Wanqing, commonly used to address Xie Wanqing in the mortal realm. when she is addressed as 娘子 (niángzǐ) alone, it is translated as “my lady.” (again: 娘子 (niángzǐ) is a polite form of address for a young woman, at least in Ye Olde Days™; it can also be used to address one’s wife, but that isn’t usually its purpose in this show.)
月族首领 巽风 Yuèzú shǒulǐng Xùnfēng (Moon Tribe Chief, Xunfeng)
character breakdown: 巽 (xùn) = to obey; one of the Eight Trigrams 八卦, symbolizing wood and wind; ☴; ancient Chinese compass point: 135° (southeast) (this definition copied directly from MDBG because all these definitions seem cool). 风 (fēng) = wind
巽风殿下 Xùnfēng diànxià: 殿下 (diànxià) is an honorific, usually meaning “Your Majesty” or “Your Highness”; Xùnfēng diànxià basically means “Your Highness Xunfeng.” he is sometimes addressed as “dianxia” alone, it’s not always Xunfeng dianxia.
to clear up possible confusion: Xunfeng is introduced in ep. 10 with the title card “Moon Tribe Chief,” per the netflix engsubs: 月族首领 (Yuèzú shǒulǐng), Moon Tribe leader/head/chief. this occurs after Dongfang Qingcang is reinstated as Moon Supreme, but in ep. 2 and ep. 10 it was mentioned that Xunfeng was made Moon Supreme (月尊 yuèzūn) upon Dongfang Qingcang’s presumed death 30,000 years earlier. as far as i've noticed, Xunfeng is referred to with 首领 (shǒulǐng) exactly once, by Yunzhong in the first episode. the kings of the North and South are also introduced with the title 首领 (shǒulǐng), while we’re on the subject. i forget which episode mentions it, but at one point Dongfang Qingcang explains that Xunfeng and the North and South You kings are all kings/chiefs under the Moon Supreme, due to power and status. Xunfeng was acting Moon Supreme in Dongfang Qingcang's absence, and 首领 (shǒulǐng) is more or less his usual job title, is how i've interpreted it.
Dongfang Qingcang and Xiao Lanhua call him Xunfeng; Shangque and most other people call him 巽风殿下 (Xùnfēng diànxià) or just 殿下 (diànxià).
random note: if you’re like me and some of my friends who have watched this show after watching or reading Tian Guan Ci Fu/Heaven Official’s Blessing, it might seem like 殿下 (diànxià) is a term specific to the prince or crown prince-type figure. turns out, that’s not exactly the case. Xie Lian’s title, 太子殿下 tàizǐ diànxià, marks him as the crown prince. 太子 (tàizǐ) = crown prince. but Xunfeng doesn’t have this title, he’s just Your Highness, 殿下. anyway, this was kinda like that one twitter meme for me. “guy who has only seen tgcf watching any other chinese drama with a prince in it: so when are they gonna call him taizi dianxia?”
another note: it seems to be somewhat common practice on tumblr to refer to his character as Dongfang Xunfeng, but i should mention that nowhere in the show does anyone append Dongfang to his name. for several reasons (see my reblog), i don’t believe Xunfeng has a last name, and i don’t think Dongfang operates like one. it’s likely that Dongfang Qingcang is just the guy’s name, and Xunfeng is just another guy’s name, and that the two brothers don’t necessarily have a family name. BUT, i will say, if you’re looking to bequeath a last name to a modern AU Xunfeng, Dongfang probably works. “Dongfang” is an actual last name, in other contexts.
水云天 帝君 云中君 Shuǐyúntiān dìjūn Yúnzhōng-jūn (Shuiyuntian Emperor, Lord Yunzhong)
character breakdown: 水云天 (Shuǐyúntiān) = lit. water, clouds, sky/heavens. 帝君 (dìjūn) = emperor. 云 (yún) = cloud, 中 (zhōng) = middle, amidst, among; i might translate the meaning of his name as Amidst the Clouds.
云中君 Yúnzhōng-jūn: Lord Yunzhong. this is his usual title when people refer to him.
君上 jūnshàng: my lord. used to directly address Yunzhong. (yes, similar to the 尊上 zūnshàng used to directly address Dongfang Qingcang; “jun” and “zun” really abound with this show, but they are different terms. don’t ask me why some characters have jun and others have zun, i only have a vague notion.)
兄君 xiōngjūn: a specific term for “brother,” used by Changheng to address and refer to Yunzhong; again, similar to how Xunfeng addresses + refers to Dongfang Qingcang with 兄尊 (xiōngzūn)
本君 běnjūn: a term used to refer to oneself, like a high-ranking “i/me,” akin to Dongfang Qingcang using 本座 (běnzuò).
in Changheng’s trial (perhaps a more official setting), Lord Yunzhong refers to his and Changheng’s father as 父神东君 fùshén Dōng-jūn, Lord Dong (lit. father-god Dong-lord) and Changheng’s mother as 母神 mǔshén (lit. mother-god). in other settings, Changheng refers to Lord Dong as 父君 fùjūn, similar to how Dongfang Qingcang and Xunfeng call their father 父尊 fùzūn.
澧沅仙尊 Lǐyuán xiānzūn (Supreme Liyuan)
character breakdown: 澧 (lǐ) = a surname, as well as a river in Hunan Province called Lishui River. 沅 (yuán) = the name of the Yuan River, another river in Guizhou and Hunan. funnily enough, both rivers flow into Dongting Lake. don’t ask me if that means anything significant, though.
仙尊 xiānzūn: Lord or my lord, in his case. similar to 仙君 (xiānjūn).
爹 diē: “father,” as addressed by his daughters. (please, it is not pronounced like the english word “die” … dee + ehh = dyeh, kinda like that)
司命仙君 Sīmìng xiānjūn (Master Arbiter/Lady Arbiter)
character breakdown: 司 (sī) = a department; to manage, take charge of, or attend to; it’s also a surname. 命 (mìng) = life, fate, destiny. so she Manages Fates, basically.
仙君 xiānjūn: Lord/Lady/Master. this word haunts me
司命星君 Sīmìng xīngjūn: also translated to Lady Arbiter, but there’s a new title this time! this is what Changheng and Dongfang Qingcang call her when they pay her a visit, near the end of the show. 星 (xīng) means star, or heavenly body. so this title means that she’s a lady of the heavens, or something similar. i wonder if this is because she was imprisoned and no longer an immortal of Shuiyuntian, where everyone is referred to with the word 仙 (xiān).
师父 shīfu: master (as addressed by Xiao Lanhua; the chinese subs say 师父, it’s a variant of 师傅, also pronounced shīfu)
sometimes addressed as just 司命 (Sīmìng), such as by Shangque and Dongfang Qingcang at the beginning of the show. by the end of the show, Dongfang Qingcang still refers to her as 司命 (Sīmìng) when speaking with Changheng, but addresses her with her title 司命星君 (Sīmìng xīngjūn) when speaking to her directly. Changheng, in contrast, keeps using her title even when she is not present.
上仙 shàngxiān: high immortal. less of a title and more of a description of her position in Shuiyuntian, e.g., “she is a high immortal of Shuiyuntian.”
海市流芳阁主 蝶衣 Hǎishì Liúfāng-gézhǔ Diéyī (Pavilion Master, Dieyi)
character breakdown: 蝶 (dié) = butterfly. 衣 (yī) = clothes, clothing; cover, skin.
阁主 gézhǔ: Pavilion Master. this is how most of the Haishi underlings address Dieyi.
流芳阁 (Liúfānggé) = Liufang Pavilion. the chinese subs use 留 instead of 流 sometimes, but for all these names and titles i default to the title cards written onscreen, not the subtitles.
三生仙君 Sānshēng xiānjūn (Master Sansheng)
character breakdown: 三 (sān) = three, 生 (shēng) = life, birth. in buddhism, 三生 (sānshēng) refers to three lives — past life, present life, and next life.
仙君 xiānjūn: Lord/Lady/Master, pretty much. if you’ve read this far you should kinda get what this means by now, right? and yes, the term is gender neutral, if anyone was wondering. a lot of these titles are.
三生姑姑 Sānshēng gūgu: Aunt Sansheng; the fairies call her this. (姑姑 gūgu refers to one’s paternal aunt, but can also be a familiar term for an aunt-like figure who is not related by blood.)
元龟 玄武 yuán guī Xuánwǔ (the Great Turtle, Xuanwu)
this dude’s got whole wikipedia pages dedicated to him but i’ll try to sum it up
玄武 (Xuánwǔ) literally means Black Warrior, Dark Warrior, or Mysterious Warrior. it is often translated as the Black Tortoise, though the name contains no animal-related words — this is just due to how it’s usually depicted. the Xuanwu is one of the four symbols of the chinese constellations, each being a guardian of one cardinal direction. the Black Tortoise’s usual epithet is 北方玄武 (běifāng Xuánwǔ), the Black Tortoise of the North. the other three are the Azure Dragon of the East (!! Dongfang Qingcang??), the White Tiger of the West, and the Vermillion Bird of the South. each symbol represents seven of the 28 Mansions; the Xuanwu would be the seven mansions of the north sky (or the god of the north sky in Taoism). each symbol is also associated with a season, time of day, and chinese element, but i’ll let you look those up yourself. anyway. tl;dr he’s a cool dude with a lot going on.
上古神灵玄武 shànggǔ shénlíng Xuánwǔ: netflix’s translation is “Great Turtle.” Xiao Lanhua calls him this when she first meets him. i might translate this title as “Ancient God Xuanwu” or similar. 上古 (shànggǔ) = distant past, ancient times, remote ages, antiquity. 神灵 (shénlíng) = god, deity, divinity, spirit, spiritual being, supernatural entity. Xiao Lanhua also addresses him by just 神灵 (shénlíng), a moment later. (it’s translated as “God” — no, not that one.)
玄武上神 Xuánwǔ shàngshén: God Xuanwu, as addressed by Xiyun. could perhaps be translated as High God Xuanwu.
元龟 yuánguī: translated by netflix as the Great Turtle. Sansheng refers to him with this term. the place where we see the Xuanwu is called 玄武幻境 (Xuánwǔ huànjìng), which basically means “Xuanwu dreamland.”
凶神太岁 xiōngshén Tàisuì (Evil God Taisui)
character breakdown: 凶神 (xiōngshén) = evil god; demon, fiend, devil. 太岁 (tàisuì) = a deity, the God of the Year, who was believed to change his dwelling on earth annually; also an archaic name for Jupiter, and a nickname for the most powerful man in a locality. (i think in this show he’s just some kind of evil deity named Taisui, not necessarily the God of the Year described in the dictionary.)
花草精灵 huā​cǎo jīng​líng (plant spirits, Xiao Lanhua's garden friends)
冬青 Dōng​qīng: Holly
爬山虎 Pá​shān​hǔ: Creeper (Parthenocissus tricuspidata)
桃树 Táo​shù: Peach (technically peach tree, but she's called Peach)
多肉 Duō​ròu​: Succulent (多肉 duō​ròu​ just means fleshy/meaty, 多肉植物 duō​ròu​zhí​wù is the name of the plant, but it's been shortened to a name in the show)
乌姑 Wū-gū (Ms. Wu, Dongfang Qingcang’s childhood caretaker who taught him woodcarving and music)
character breakdown: 乌 (wū) is a surname, but it can also mean “crow” or “black/dark.” 姑 (gū) refers to one’s aunt, a father’s sister; here, it is Dongfang Qingcang’s familiar term for her. (same concept as with Aunt Sansheng, although i’m not sure why it’s translated to Ms. Wu instead of Aunt Wu, especially since she seemed to have a very close relationship with Dongfang Qingcang. the singular 姑 (gū) might convey a bit less familiarity or closeness In Olden Times compared to 姑姑 (gūgū), and Dongfang Qingcang as the young lord might have had to maintain that marginal bit of distance for politeness and tradition and royalty reasons, but i could very much be mistaken, or just reading into it more than necessary.)
look, i know she’s not a major character but she was important to ME, ok! so here’s her name. hope someone writes a fic involving her someday.
长渊 Chángyuān (Arbiter’s dragon husband)
character breakdown: 长 (cháng) = long/length; forever, always, constantly. 渊 (yuān) = deep pool; deep; profound.
罪龙长渊 zuìlóng Chángyuān: convicted dragon Changyuan, dragon criminal Changyuan. same 罪 (zuì) as in “immortal criminal,” 罪仙 (zuìxiān).
星落 Xīngluò (Danyin and Jieli's Moon Tribe mother)
character breakdown: 星 (xīng) = star or heavenly body. 落 (luò) can mean many things, but generally refers to something lowering or retreating, such as the setting sun or receding tide. her name can be loosely translated as Setting Star. Supreme Liyuan addresses her by name.
母亲 mǔ​qīn: mother, mom (archaic). this is how Danyin (and Jieli?) refers to her.
彤云 Tóngyún (Xie Wanqing's younger assistant/aide/maid)
character breakdown: 彤 (tóng) is a common surname, 云 (yún) = cloud.
also, Xie Wanqing's elder aide or advisor is referred to as 妈妈 Mama. i didn't catch an actual name for her.
aaaaaall righty, i am done for now. (it’s been over a week… phew…) again, i’ll update this if i discover new things or receive suggestions. thanks! :D
373 notes · View notes
siva3155 · 6 years ago
Text
300+ TOP CLOJURE Interview Questions and Answers
Clojure Interview Questions for freshers experienced :-
1. What is Clojure? Clojure is a dynamic, general-purpose programming language. It is simple, coherent and powerful tool. It is based on Lisp Programming language. 2. Which platform is used to run Clojure? JVM (Java Virtual Machine), CLR (Common Language Runtime) and JavaScript are platform used to run Clojure. 3. Who designed the Clojure? Rich Hickey designed the Clojure. 4. What is the stable version of Clojure? The stable version of Clojure is 1.8 and released on 19 January 2016. 5. How to write a simple program of Clojure? The following code for write a simple program: (ns clojure.examples.hello (:gen-class)) (defn hello-world (println (format "Hello, %s" username))) (hello-world "world") 6. What are the features of Clojure? There are various following features of Clojure: It is based on the Lisp programming Language. It is functional programming language. It manages the state of an application. It supports concurrency. 7. What is the use of StructMaps? StructMaps are used to create structures. 8. What is the filename extension of Clojure? Clojure filename extension are: clj, .cljs, .cljc, .edn 9. What is the keyword to define a function? The function keyword is used to define the function. 10. What is REPL in Clojure? REPL stand for read eval print loop. It is a tool for Clojure code.
Tumblr media
CLOJURE Interview Questions 11. How to launch a REPL? The following command is used to launch a REPL: java -cp clojure.jar clojure.main 12. What are the Clojure variables? There are following Clojure variables: Short Int Long Float Char Boolean String 13. How to declare a variable in Clojure? The following code for declare a variable in Clojure: (def var-name var-value) 14. What are the operators in Clojure? Clojure has following operators that are given below: Arithmetic operators Relational operators Logical operators Bitwise operators 15. What is the syntax for declaration the operator and operands in Clojure? In Clojure, the following syntax for declaring the operator and operand is: (operator operand1 operand2 operandn) 16. What is clojure.main namespace in Clojure? Clojure.main namespace provides functions that allow Clojure program and interactive sessions. 17. What are the properties of Socket Server? The following socket Server properties are: Socket Server Properties Description server-daemon It is by defaults true and socket server thread doesn’t block exit. Address It hosts or address, It is by defaults to loopback. Port It uses positive integer, it is required. Accept It is namespaced symbol of function. It is used to invoke on socket accept, it is required. Args It is sequential collection of args to pass to accept. bind-err It is by default true, and binds *err* to socket out stream. client-daemon It is by default true and socket client thread doesn’t block exit. 18. What is set in Clojure? In Clojure, set is unique value that is created with the help of the set command. Example: (ns clojure.examples.example (:gen-class)) (defn example (println (set '(1 1 2 2)))) (example) 19. What is the use of Macros in Clojure? Macro is used to define the syntactic constructs which would require primitives or built-in support in other languages. 20. What is Map in Clojure? Map is a collection, which is used to maps the Keys to the values. It provided two types of Map: HashMaps SortedMaps 21. What is Clojure Namespace? Clojure Namespace is used to specify the classes into separate logical spaces. 22. What are the special variables? There are following two types of special variables: &form : The actual form (as data) that is being invoked &env : A map of local bindings. It is from symbols that is used to objects holding and compiler information about the binding. 23. What is the use of Clojure libs? A lib is a named unit of Clojure source code. It contained in a java resource within classpath. Closer provides code loading and dependency tracking via lib. Example: (ns com.my-company.clojure.examples.my-utils (:import java.util.Date) (:use ) (:require )) 24. What is Atoms in Clojure? In Clojure, atom is a data type that provides a way to manage shared synchronous, independent state. Example: (ns clojure.examples.example (:gen-class)) (defn example (def myatom (atom 1)) (println @myatom)) (example) Clojure Questions and Answers Pdf Download Read the full article
0 notes
a-coda · 8 years ago
Text
Too Lazy
"The three chief virtues of a programmer are: Laziness, Impatience and Hubris." -- Larry Wall
I'd been looking around for a tractable Clojure side-project for a while, but I'd been a bit lazy. I didn't want anything too demanding. I didn't want to have to learn some new sub-domain in any detail. I also didn't want to deal with complex user-interface issues. I thought it would be nice to look at some batch-processing problem where I could explore Clojure's data structures and concurrency. As it happens, we have such a data processing task at Linguamatics.
We do text mining. One of our sets of source documents is Medline. This is a bibliographic database from the U.S. National Library of Medicine (NLM). It has more than 24 million references to life sciences and biomedical journal articles. Medline is available as a sets of gzipped XML documents via an FTP server. There is a base set published at the start of the year, and then updates are published daily. The updates have brand new records, replacement records, and deletions. The problem task is to combine the updates with the base to produce a consolidated set of sources to do text mining on.
We have various implementations of the consolidation process including Perl and Python scripts, and a Java module in our main product. We make the Perl script available as an unsupported example.
Where to get started with a Clojure version? I wanted to start from scratch. I didn't want to convert an existing program. But first I needed some data. Fortunately, NLM makes a sample set of Medline records available online.
Now how to process them? The main thing to realize is the Medline archives are basically flat and consist of two kinds of XML records: MedlineCitation and DeleteCitation. Each of these has a PubMed ID (PMID). Here is an example:
<MedlineCitation Owner="NLM" Status="MEDLINE"> <PMID Version="1">23925621</PMID> <DateCreated> <Year>2013</Year> <Month>08</Month> <Day>08</Day> </DateCreated> ... </MedlineCitation>
So the immediate thing I decided to do, and the focus of this blog post, was see if I could extract all the PMIDs from the sample dataset. Should be simple enough right? Fortunately, Clojure has some nice XML handling which works by reading the XML and treating like a Clojure data structure. I only need to call the following:
(clojure.data.xml/parse input)
I can then get the content from the document level MedlineCitationSet tag via:
(:content (clojure.data.xml/parse input))
Now I want the PMIDs from all the MedlineCitation records so I just map over the content:
(map pmid (:content (clojure.data.xml/parse input)))
where "pmid" is a function which pulls out the PMID from each record of the right type:
(defn pmid [citation] (if (= (:tag citation) :MedlineCitation) (-> (:content citation) first :content first)))
Now we can just wrap it up in something that reads the file:
(defn read-medline [file] (with-open [input (java.io.FileInputStream. file)] (map pmid (:content (clojure.data.xml/parse input)))))
and print out the result:
(defn -main [& args] (println (read-medline (first args))))
and run it using Leiningen on an old sample file:
lein run medsamp2014.xml
But I got a strange error!
(Exception in thread "main" javax.xml.stream.XMLStreamException: ParseError at [row,col]:[204,54] Message: Stream Closed, compiling:(C:\Users\jtrenouth\AppData\Local\Temp\form-init8439088870268620699.clj:1:112) at clojure.lang.Compiler.load(Compiler.java:7391) at clojure.lang.Compiler.loadFile(Compiler.java:7317) at clojure.main$load_script.invokeStatic(main.clj:275) at clojure.main$init_opt.invokeStatic(main.clj:277)
What on earth was going on? "Stream Closed"? Why did the stream end at some random character position: row 204, column 54? After much puzzling it dawned on me. Clojure's XML data library was returning a lazy data structure. The "read-medline" function wasn't actually reading the sample file at all. It was returning a data structure backed by the stream. The stream would be read if any one interrogated the data structure later. And calling "println" was doing exactly that.
In effect, I was passing a reference to the stream out of the "with-open" expression which was closing it on the way out. Some initial portion of the stream had already been read and buffered, but that was it. As soon as "main" method tried to print the result of the computation the closed stream had to be read again and I got the error.
What could realize the computation before it exits the "with-open" expression? As it happens, I wanted to make a set of the PMIDs and it turns out making a set isn't lazy so it does the job:
(defn read-medline [file] (with-open [input (java.io.FileInputStream. file)] (set (map pmid (:content (clojure.data.xml/parse input))))))
And we get the desired output, e.g.:
#{nil 10192115 12211266 8655018 ...}
(The "nil" is because some of the records aren't MedlineCitations.)
"So you learnt something," said a colleague while we were standing outside in the Summer sunshine. I had to agree.
"Deep summer is when laziness finds respectability." -- Sam Keen
0 notes
aceinthetrap · 2 years ago
Text
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
Cang Lan Jue character updates 8.7.2023 @weibo
1 note · View note
gima326 · 10 months ago
Text
マクロ千本ノック その3−2
んじゃ、そろそろ「~@」を使ってみようか。 (defmacro m6_5 []  `(list   ~@(cons 0 '(1 2 3))))
marubatsu.core=> (macroexpand-1 '(m6_5)) (clojure.core/list 0 1 2 3)
marubatsu.core=> (m6_5) (0 1 2 3) クォートを使ってたままだと、エラーになる。
(defmacro m6_6 [data]  `(list   ~@(cons 0 '(1 2 3 data))))
marubatsu.core=> (macroexpand-1 '(m6_6 b)) (clojure.core/list 0 1 2 3 data)
marubatsu.core=> (m6_6 b) Syntax error compiling at (/private/var/folders/0f/sxcdk68s7_n0ml_kmhqc989h0000gn/T/form-init8422733203154816707.clj:1:1). Unable to resolve symbol: data in this context list を明示して使う。
(defmacro m6_7 [data]  `(list   ~@(cons 0 (list 1 2 3 data))))
marubatsu.core=> (macroexpand-1 '(m6_7 b)) (clojure.core/list 0 1 2 3 b)
marubatsu.core=> (m6_7 b) (0 1 2 3 [1 2 3 4 5 6 7 8 9])
0 notes
gima326 · 10 months ago
Text
マクロ千本ノック
ばっちこーい!
marubatsu.core=> (def a '( \\. \\. \\. \\. \\. \\. \\. \\. )) 'marubatsu.core/a (defmacro m0 [data]  data)
marubatsu.core=> (macroexpand-1 '(m0 a)) a
marubatsu.core=> (m0 a) ( \\. \\. \\. \\. \\. \\. \\. \\. ) クォートしてみると?
(defmacro m1 [data]  'data)
marubatsu.core=> (macroexpand-1 '(m1 a)) data marubatsu.core=> (m1 a) Syntax error compiling at (/private/var/folders/0f/sxcdk68s7_n0ml_kmhqc989h0000gn/T/form-init8422733203154816707.clj:1:1). Unable to resolve symbol: data in this context 「data なんて見つからないよ」と言われる。 引数の名前を変更する(data -> a)。すでに定義済みの「a」なら、いちおう動作してくれる(意図しない、変数捕捉)。
(defmacro m2 [a]  'a)
marubatsu.core=> (macroexpand-1 '(m2 a)) a
marubatsu.core=> (m2 a) ( \\. \\. \\. \\. \\. \\. \\. \\. ) list 関数を掛けてみる。 変数「a」がリストの先頭のため、関数と見なされるため、エラーになってしまう。 (defmacro m3 [data]  (list data))
marubatsu.core=> (macroexpand-1 '(m3 a)) (a)
marubatsu.core=> (m3 a) Execution error (ClassCastException) at marubatsu.core/eval2985 (form-init8422733203154816707.clj:1). class clojure.lang.PersistentList cannot be cast to class clojure.lang.IFn (clojure.lang.PersistentList and clojure.lang.IFn are in unnamed module of loader 'app') 「m3」と同じ結果になるのは分かっているけれど。
(defmacro m4 [data]  `(~data))
marubatsu.core=> (macroexpand-1 '(m4 a)) (a)
marubatsu.core=> (m4 a) Execution error (ClassCastException) at marubatsu.core/eval3005 (form-init8422733203154816707.clj:1). class clojure.lang.PersistentList cannot be cast to class clojure.lang.IFn (clojure.lang.PersistentList and clojure.lang.IFn are in unnamed module of loader 'app')
0 notes
gima326 · 10 months ago
Text
Clojure で「マルバツ」を作成してみたが その2
当初、盤面を表示するのに macro を使うつもりだった。 (defmacro print-marubatsu-board [data]  `(print   (format    "\n A B C \n # # # #\n1 # %c %c %c \n2 # %c %c %c \n3 # %c %c %c \n"    ~@data)))
marubatsu.core=> (print-marubatsu-board [ \\. \\. \\. \\. \\. \\. \\. \\. \\. ]) A B C # # # # 1 # . . . 2 # . . . 3 # . . . nil 値そのもの([ \\. \\. \\. \\. \\. \\. \\. \\. \\. ])を引数に設定するぶんにはうまく動作してたけれど、現実的には、値を束縛した変数が設定される。 marubatsu.core=> (def init_b [ \\. \\. \\. \\. \\. \\. \\. \\. \\. ]) #'marubatsu.core/init_b …すると、こうなる。 marubatsu.core=> (print-marubatsu-board init_b) Syntax error (IllegalArgumentException) compiling at (/private/var/folders/0f/sxcdk68s7_n0ml_kmhqc989h0000gn/T/form-init16106022240644337793.clj:1:1). Don't know how to create ISeq from: clojure.lang.Symbol 対応するには eval を用いるしかないのか? (defmacro print-marubatsu-board2 [data]  `(print   (format    "\n A B C \n # # # #\n1 # %c %c %c \n2 # %c %c %c \n3 # %c %c %c \n"    ~@(eval data)))) はい、動きはする。 marubatsu.core=> (print-marubatsu-board2 init_b) A B C # # # # 1 # . . . 2 # . . . 3 # . . . nil なるべく eval を使わないように、ふつうの関数で実現するのが穏当なのだろう、と判断した。引数を分配束縛している。 (defn print-marubatsu-board3 [ [a b c d e f g h i] ]  (print   (format    "\n A B C \n # # # #\n1 # %c %c %c \n2 # %c %c %c \n3 # %c %c %c \n"    a b c d e f g h i))) …まぁ、動くよね。 ただ、やっぱり引数がいっぱいってのがどうにもねぇ。 marubatsu.core=> (print-marubatsu-board3 init_b) A B C # # # # 1 # . . . 2 # . . . 3 # . . . nil
0 notes
gima326 · 1 year ago
Text
『関数型デザイン』(Robert C. Martin 著、角 征典 訳) その2
第6章「素因数分解」 Clojure では(まどろっこしくて)、これまでやったことがなかったけれど、TDD をもちいて漸進していくアプローチが新鮮だった。 speclj [ https://github.com/slagyr/speclj ] //================= にしても。 require すると、こんなふーにエラーになるのはなんでだろう? prime-factors.core=> (require '[speclj.core :refer :all]) Syntax error compiling at (speclj/run/standard.cljc:103:9). Unable to resolve symbol: update-keys in this context //================= まぁ、細かいオプションを除けば使えるようなので、いいか。 prime-factors.core=> (use '[speclj.core]) nil ;; 未定義の関数「prime-factors-of」をテストに掛ける。 ;; 無事、エラーとなる prime-factors.core=> (should= [] (prime-factors-of 1)) Syntax error compiling at (/private/var/folders/0f/sxcdk68s7_n0ml_kmhqc989h0000gn/T/form-init3563622502753811837.clj:1:13). Unable to resolve symbol: prime-factors-of in this context ;; 最低限度の内容で、関数定義。 prime-factors.core=> (defn prime-factors-of [num] []) 'prime-factors.core/prime-factors-of ;; 再度、テストを実施。エラーが出なくなった。 prime-factors.core=> (should= [] (prime-factors-of 1)) nil ;; 期待値が異なっている場合、こんなふーにエラーが出る。 prime-factors.core=> (should= [1] (prime-factors-of 1)) Execution error (SpecFailure) at prime-factors.core/eval3609 (form-init3563622502753811837.clj:1). Expected: [1]  got: [] (using =)
0 notes
aceinthetrap · 3 years ago
Text
Cang Lan Jue concept designs
Tumblr media Tumblr media
Arbiter Hall, Shui Yun Tian
Tumblr media Tumblr media Tumblr media Tumblr media
Yu Jing, Shui Yun Tian
Tumblr media Tumblr media Tumblr media
Hao Tian Matrix
Tumblr media
Yunzhong Water Pavilion, Shui Yun Tian
Source: 导演伊峥 (苍兰诀 director Yi Zheng)
Added: Xuanxu Realm, Ancient Battlefield
Cangyan Sea
<<I'm probably ruined for other fantasy shows not produced by this team>>
601 notes · View notes
aceinthetrap · 2 years ago
Text
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
@王一栩SPro
3.25 New character photos from 苍兰诀 producer
174 notes · View notes
aceinthetrap · 2 years ago
Text
Tumblr media Tumblr media Tumblr media
[new photos released by CLJ's producer @王一栩SPro, 1.25.2023]
115 notes · View notes
aceinthetrap · 3 years ago
Text
It started with cute chibi illustrations, and now here we are ...
Here's how it's going @djappleblush 🫣🫣🫣
Tumblr media Tumblr media Tumblr media Tumblr media
^^ ctto
335 notes · View notes
aceinthetrap · 3 years ago
Text
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
Cang Lan Jue large header / banner
*edited and split into 5 parts by me
Source: 苍兰诀 Official Weibo
365 notes · View notes