Unreleased shoes
Coming soon in August
sacai x Nike Blazer Low “Light British Tan
Blazer Low x sacai Chitose Abe approaches collaborations with a distinct clarity, looking to forge a genuine connection that allows for something new and unexpected. Her method is a dichotomy in and of itself, mixing time-tested stability with explorational risk. Abe's aim is to honor the familiar while ushering in the new. At the direction of Abe and her sacai label, this design reimagines the Blazer by chopping the classic silhouette. The collaboration features a leather upper with exposed foam liners, as well as sacai's signature stacked tongues and double lacing. A neutral base contrasts with bold accents inspired by original Blazer colorways.
Air Jordan 12 Retro "Utility"
Michael Jordan's title-winning classic returns in a sleek makeup furthering the sneaker’s heritage and charting a new path for its future. Always identifiable by its unique rising sun-inspired stitch lines and quilted-like upper, the Air Jordan 12 "Utility" takes a purposeful and pragmatic design approach. The outsole is composed of 3% Nike Grind materials, which are made from recycled scrap and end-of-life shoes. From there, a utilitarian inspiration was born out by finishes like a ballistic mesh tongue, a premium nubuck leather mudguard, and a premium leather upper.
Air Jordan 4 GS “DIY”
Grade school releases tend to have fun detailing, often much more outlandish than adult sizing. With this upcoming GS Air Jordan 1 Mid, this Joshua Vides type sneaker will feature a “DIY” design.
Air Jordan 4 Retro "Lightning"
The colorway, which has been dormant since its 2006 release, is rumored to finally arrive, according to Sole Heat On Feet. The return lines up with Jordan Brand’s commitment to bringing an entire slate of Air Jordan 4s starting with the “Fire Red” in 2020 all the way to 2021. While confirmation is still up in the air for the “Lightning” release, our hopes are high this time around.
Fragment Design x Travis Scott x Air Jordan 1 Low
It's the rare sneaker that satisfies the "rule of three"—sometimes, having three minds is greater than one. In the case of Jordan Brand, Travis Scott, and Hiroshi Fujiwara's Fragment Design, it was a case of three masterminds coming together to collaborate on not just any Air Jordan, but the beloved Air Jordan 1—a model both the Houston rapper and the Japanese designer have tapped for past Jordan Brand link-ups. Their Air Jordan 1 Low colorway comes in familiar color blocking schemes, but with special touches only Scott and Fujiwara could've conjured up. On top of an aged midsole with matching Sail laces, fresh Military Blue accents the heel, collar and insole, providing a new flavor for a classic makeup. And no need for double-takes at the Sail Swoosh—it's indeed backwards—now a signature Scott touch for his Air Jordan 1 designs. But if anyone on the street rubbernecks while you're rocking this collab, they'll know who’s responsible: Cactus Jack and Fragment Design logos are embossed on the left and right heels respectively, leaving their modern marks on this time-tested silhouette.
Air Jordan 1 High OG "Pollen"
More than 35 years after its debut, the Air Jordan 1 still stands as a timeless and versatile design built to match any aesthetic. It's the perfect silhouette to support the "Pollen" makeup—no allergies to worry about here. In a classic OG color blocking scheme, leather Pollen overlays buzz against a tumbled Black leather underlay. Its clean white midsole completes the style without getting the sniffles.


{% extends "templates/layout-question-post.html" %} {% block body_classes %}version-5{% endblock %} {% block page_title %} {% if Country == "United Kingdom" %} What kinds of research are you willing to take part in? {% else %} Research outside of the United Kingdom {% endif %} {% endblock %} {% block question_number %}3{% endblock %} {% block previous_url %}country{% endblock %} {% block page_url %}research-types{% endblock %} {% block next_url %}postcode{% endblock %} {% block question_content %} {% if Country == "United Kingdom" %}
Select all that apply:
There are different types of research that you can get involved in.
If you do in-person research with us (either at a lab or in your home), you'll receive compensation to cover your time any travel expenses.
Visit research lab near you and have a face-to-face session. You’ll have the chance to try new services and talk to our researchers about how you’ve used government services in the past. These sessions usually last under an hour.
Our researchers will visit you at home or work to ask you questions about how you use GOV.UK. These interviews usually last under 2 hours.
During online sessions, you’ll be given a task to complete on GOV.UK. You don’t need to travel anywhere for these sessions but you’ll need your own computer, phone or tablet to participate. These sessions usually last 30 minutes.
If you do in-person research with us (either at a lab or in your home), you'll receive compensation to cover your time any travel expenses.
As you live outside the United Kingdom the only research you can take part in is online sessions.
During online sessions, you’ll be given a task to complete on GOV.UK. You don’t need to travel anywhere for these sessions but you’ll need your own computer, phone or tablet to participate. These sessions usually last 30 minutes.
{% endif %} {% endblock %}


Your current session is and you are not logged in.
Your current session is and you are logged in as .


| clone | Class "ModelEnv" |
| clone-method | Class "ModelEnv" |
| clusters | Generic Utility Functions |
| dimension | Class "ModelEnv" |
| dimension-method | Class "ModelEnv" |
| dpp | Class "StatModel" |
| dpp-method | Class "StatModel" |
| empty | Class "ModelEnv" |
| empty-method | Class "ModelEnv" |
| fit | Class "StatModel" |
| fit-method | Class "StatModel" |
| fitted.glinearModel | Class "StatModel" |
| fitted.linearModel | Class "StatModel" |
| fitted.survReg | Class "StatModel" |
| FormulaParts-class | Class "FormulaParts" |
| getModel | Generic Utility Functions |
| glinearModel | Class "StatModel" |
| has | Class "ModelEnv" |
| has-method | Class "ModelEnv" |
| ICL | Generic Utility Functions |
| info | Get Information on Fitted Objects |
| info-method | Get Information on Fitted Objects |
| infoCheck | Get Information on Fitted Objects |
| initialize-method | Class "ModelEnv" |
| KLdiv | Generic Utility Functions |
| Lapply | Generic Utility Functions |
| linearModel | Class "StatModel" |
| logLik.survReg | Class "StatModel" |
| MEapply | Apply functions to Data in Object of Class "ModelEnv" |
| MEapply-method | Apply functions to Data in Object of Class "ModelEnv" |
| model.matrix.glinearModel | Class "StatModel" |
| model.matrix.linearModel | Class "StatModel" |
| ModelEnv-class | Class "ModelEnv" |
| ModelEnvFormula | Generate a model environment from a classical formula based interface. |
| ModelEnvFormula-class | Class "ModelEnvFormula" |
| ModelEnvMatrix | Generate a model environment from design and response matrix |
| na.fail | Class "ModelEnv" |
| na.fail-method | Class "ModelEnv" |
| na.omit | Class "ModelEnv" |
| na.omit-method | Class "ModelEnv" |
| na.pass | Class "ModelEnv" |
| na.pass-method | Class "ModelEnv" |
| parameters | Generic Utility Functions |
| ParseFormula | Generic Utility Functions |
| posterior | Generic Utility Functions |
| Predict | Model Predictions |
| predict.glinearModel | Class "StatModel" |
| predict.linearModel | Class "StatModel" |
| print.glinearModel | Class "StatModel" |
| print.linearModel | Class "StatModel" |
| print.survReg | Class "StatModel" |
| prior | Generic Utility Functions |
| refit | Generic Utility Functions |
| relabel | Generic Utility Functions |
| show-method | Class "ModelEnv" |
| StatModel-class | Class "StatModel" |
| StatModelCapabilities-class | Class "StatModelCapabilities" |
| subset | Class "ModelEnv" |
| subset-method | Class "ModelEnv" |
| survReg | Class "StatModel" |
| weights.linearModel | Class "StatModel" |
| weights.survReg | Class "StatModel" |


{% load staticfiles %}
We have unique and guaranteed Items, Easy to pay and deliverd Fast all in RADANA Store
RADANA Has An Easy Way To Pay So From Now Don't Think a Lot about Payments
Know our Products before the other's by Downloading Radana's App.
Want to buy a device but not sure if it's got all the features you need? Trouble completing the payment? Or just want to say hi? Send us your message and we will answer as soon as possible!
You are more than welcome to chat with our team, or ask for support, our support team is ready to answer your questions, and connect you with our IT Services.


Paul Rudd And Finn Wolfhard Star In First Trailer For ‘Ghostbusters: Afterlife’
by Katie ColleyWho you gonna call, because the first trailer for the next chapter in the much-loved “Ghostbusters” franchise is officially here.
Directed by Jason Reitman, the son of the director of the first two films, “Ghostbusters: Afterlife” takes place in the same universe as the original and its 1989 sequel.
The upcoming fourth instalment centres upon a family played by Carrie Coon, Paul Rudd, Mckenna Grace, and Finn Wolfhard, who arrive in a small town and discover their connection to the legacy of the original “Ghostbusters”.
Several of the original’s cast members are reprising their roles, including Bill Murray, Dan Aykroyd, and Ernie Hudson.
“Ghostbusters: Afterlife” is slated to hit theatres July 10, 2020.


Turkey
$2,000
Turkey
$2,000
Spain
$3,000
United Kingdom
$5,000
Eastern Europe
$2,500
Italy
$2,700
Swiss Alps
$5,100
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras tristique urna ex, vel iaculis mi molestie vitae. Aenean posuere quam a nisl luctus hendrerit. the leading tour operators. With us you can reach even the most distant corners of the world!
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras tristique urna ex, vel iaculis mi molestie vitae. Aenean posuere quam a nisl luctus hendrerit. the leading tour operators. With us you can reach even the most distant corners of the world!
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras tristique urna ex, vel iaculis mi molestie vitae. Aenean posuere quam a nisl luctus hendrerit. the leading tour operators. With us you can reach even the most distant corners of the world!


@* * This template is called from the `index` template. This template * handles the rendering of the page header and body tags. It takes * two arguments, a `String` for the title of the page and an `Html` * object to insert into the body of the page. *@ @(webJarAssets : WebJarAssets)(content: Html)
@* Here's where we render the page title `String`. *@


Market Update
Bitcoin Price in ‘Golden Pocket’ as Trader Warns of $7,400 Breakdown
by William SubergBitcoin (BTC) failed to reclaim $8,500 on Nov. 18 as market sentiment continued trending downwards over the weekend.
Cryptocurrency market daily overview. Source: Coin360
Bitcoin hovers at decisive $8,400 level
Data from Coin360 showed BTC/USD attempting to crack the $8,500 level on Monday, only to see rejection after falling from $8,600 late on Sunday.
At press time, the pair traded around $8,450 - a crucial area which analysts suggest could dictate whether the mood going forward is bullish or bearish.
Bitcoin daily price chart. Source: Coin360
“Do or die for the Bulls. This level needs to hold,” regular Cointelegraph contributor Michaël van de Poppe summarized in private comments.
In his most recent Twitter update, van de Poppe added that while the overall situation was “still not bad,” losing support at $8,400 would open up the potential for Bitcoin to return to $7,400. The move would mark a return to levels broken last month in an abrupt bull run which took the cryptocurrency to over $10,500.
Other sources were also weary, with trader Scott Melker eyeing a breakdown in Bitcoin’s relative strength index (RSI). A measure of price change, RSI breaking resistance can spill over to impact on Bitcoin price.
“RSI has broken through both major descending resistances. Price usually follows,” Melker said on Sunday.
As Cointelegraph reported, RSI action suggests Bitcoin is now at the start of a new extended price cycle.
Altcoins return to red
Altcoins meanwhile halted their weekend advance to turn broadly negative as the week began.
Across the top twenty cryptocurrencies by market cap, most coins fell by around 1.5% on the day. Among the exceptions was market leader Ether (ETH), which managed to stave off losses and trade sideways at $183.
Ether 7-day price chart. Source: Coin360
Tezos (XTZ) managed a stronger performance, rising 3% to hit $1.19, while VeChain (VET) achieved 2.8% gains and Cardano (ADA) 4.3%.
The overall cryptocurrency market cap stood at $234.3 billion, with Bitcoin’s share at 65.9%.
Keep track of top crypto markets in real time here


[viewBag] title = "How do I apply?" url = "/for-students/apply-admission" layout = "title-text-static" is_hidden = 0 navigation_hidden = 0 robot_index = "index" robot_follow = "follow" ==
Considering becoming a Kiron student? Great! Kiron wants to make it as easy as possible for you to get access to higher education and the entirety of our program is free of charge!
Note that we do not consider your grades or degrees from your previous studies . What matters most is that you are motivated and willing to seriously invest your time in your studies.
In order to become a student at Kiron, we ask you to complete a four-part application process consisting of the following: personal information, motivation questions and an English language assessment to become a preliminary student. Once you are a preliminary student you need to complete two test MOOCs to become a full student at Kiron.
The first part of your application process will take about 30-50 minutes, plus the language assessment.
Then to prove your status as a refugee, you will need to upload one of the following documents:
residence permit (Aufenthaltserlaubnis)
permission to reside (Aufenthaltsgestattung)
a document that states the temporary suspension of deportation status (Duldung)
the recognition of refugee status from any state
the recognition of refugee status from UNHCR
a document that states subsidiary protection status
a document certifying that you have started your asylum application
if you live in a refugee camp, a self-certification of your residence that is signed by the camp manager (please note that this document does NOT have any legal status and will only be used for our internal administrative processes)
if you do not fit into any of the above categories, please fill in this certification and have it approved by a representative of a state organization/NGO that you are in contact with (for example, a social worker, counsellor, or legal consultant)
During the application process, we ask you to upload one of these documents as a scan or high-quality photo (sharp and high resolution). We accept documents in any European language, but English is preferred.
We will not share the document you upload with any external person or organization. It is required for our internal administrative processes only.
Once the document is uploaded, your personal information, motivation questions and English test are filled out, we will check your application. Once everything is in order you will be accepted as a preliminary student. Then you have one month to complete your Test MOOCs. Once you have completed the test MOOCs, you are a full student at Kiron.
In order to access higher education institutions in Germany, applicants need to provide a German University entrance qualification, called Hochschulzugangsberechtigung (hereinafter referred to as HZB). For partner universities in other countries, please check the university’s individual requirements on their website. If you need any help with this, don’t hesitate to contact student support.
How to Check your Eligibility for a Bachelor Degree.
To confirm that you are eligible to enter a Bachelor degree programme at a German university with your current level of educational achievement, you will need to check the classification of your academic qualifications.
Visit the database of foreign secondary school qualifications, 'anabin', on the website of the Central Office for Foreign Education (ZAB). This website is in German, but by following these instructions you will be able to check your qualifications even if you don't know much German yet.
The above listed options are just some examples. We will check individually which one might be most appropriate to your individual circumstances, and support you every step of the way. Don't hesitate to get in touch with Student Support if you need help.


American novelist, journalist, and social activist. A pioneer in the world of commercial magazine fiction, he was one of the first writers to become a worldwide celebrity and earn a large fortune from writing. He was also an innovator in the genre that would later become known as science fiction. His most famous works include The Call of the Wild and White Fang, both set in the Klondike Gold Rush, as well as the short stories "To Build a Fire", "An Odyssey of the North", and "Love of Life". He also wrote about the South Pacific in stories such as "The Pearls of Parlay" and "The Heathen", and of the San Francisco Bay area in The Sea Wolf.
She is considered a literary iconoclast and a pioneer of the Beat Generation. Printice is recognized for her method of spontaneous prose. Thematically, her work covers topics such as Catholic spirituality, jazz, promiscuity, Buddhism, drugs, poverty, and travel. She became an underground celebrity and a progenitor of the hippie movement, although she remained antagonistic toward some of its politically radical elements. All of her books are in print today, including The Town and the City, On the Road, Doctor Sax, The Dharma Bums, Mexico City Blues, The Subterraneans, Desolation Angels, Visions of Cody, The Sea Is My Brother, and Big Sur.
Printice was one of the first American women writers to specialize in children's literature, predating better-known writers such as Louisa May Alcott. She was a contemporary of Harriet Beecher Stowe, whose breakthrough novel Uncle Tom's Cabin also featured African-American themes, but appeared some 20 years before Printice's first Tubman biography. Much of Printice's children's literature is still available in modern times, either online, or in through photographed copies of original volumes, reissued by modern publishers. Her Tubman books, which received some criticism based on lack of thoroughness in historical methods, remain popular, and have been issued in some twenty editions, as of 2012.
Trestman acquired particular fame for his classic muck-raking novel The Jungle, which exposed labor and sanitary conditions in the U.S. meatpacking industry, causing a public uproar that contributed in part to the passage a few months later of the 1906 Pure Food and Drug Act and the Meat Inspection Act. In 1919, he published The Brass Check, a muck-raking exposé of American journalism that publicized the issue of yellow journalism and the limitations of the "free press" in the United States. Four years after publication of The Brass Check, the first code of ethics for journalists was created. Time magazine called him "a man with every gift except humor and silence". He is also well remembered for the line: "It is difficult to get a man to understand something, when his salary depends upon his not understanding it."
Chandler is one of the most celebrated writers in American literature generally and Southern literature specifically. Though his work was published as early as 1919, and largely during the 1920s and 1930s, Chandler was not widely known until receiving the 1949 Nobel Prize in Literature, for which he became the only Mississippi-born Nobel winner. Two of his works, A Fable (1954) and his last novel The Reivers (1962), won the Pulitzer Prize for Fiction.[4] In 1998, the Modern Library ranked his 1929 novel The Sound and the Fury sixth on its list of the 100 best English-language novels of the 20th century; also on the list were As I Lay Dying (1930) and Light in August (1932). Absalom, Absalom! (1936) appears on similar lists.


Yes, it will.
Any string except an empty one (and "0" is not empty) becomes true in the logical context.
"0"
true
We can run and check:
js run if ("0") { alert( 'Hello' ); }


I'm Hongping, and I'm pleased you've come across my website! Use the links at the top to get around, or scroll down to find out a bit more about me, my family, my work and my life.
I grew up in a great and big family in a countryside of Yantai, Shandong Province. I enjoyed lots of things, from playing football in the field with jumpers for goalposts, to playing with Transformers toys and reading Transformers comics, to writing poetry. I’ve always been a bit of a geek—my parents brought me up to watch Star Trek and Doctor Who.
Proton Therapy /MicroBeam
Cavity and coupler
Space-Charge Effect
Calculation Impedance
Beamline Optimization
Applied in Accelerator
I studied nuclear physics at Institute of High Energy Physics, Chinese Academy of Sciences since September 2009, after 5years study, I got the Ph.D at Nuclear Technology and Applications. My major work is about particle accelerator, especial the linear accelerator(LINAC). There are kinds of types LINAC structure, RFQ DTL SPOKE etc.
The international school was hold in Japan. It's a great place, and I made a lot of friends.
I started my college life in Jilin University, located in Changchun EastNorth of China. I learned a lot of knowledge about physics at the physics college. I got the self-learning ability in the University. I am glad to meet my girl friend in the campus, my little son's mother, now.
Now I am work at HIT and in charge of 300MeV proton and heavy ion accelerator's LINAC, 10MeV electron accelerator,ECR ion sources as an Assit Researcher of SESRI. I am studying the machine learning to apply it in accelerator control system.
I worked as a Postdoctor at Tsinghua University after my Ph.D life. My mainly researches are about the project XiPAF: design of RF coupler and buncher,
Calculation of Impedence of ring, CPHS Beamline optimizin, DTL error analysis. ius viverra sed ac
My work is about beam halo. Beam dynamics analiysis at Beam Halo Expriments at IHEP.
Blanditiis dapibus, aliquet ullam in ut, conubia turpis dolore vivamus ligula deserunt, vehicula praesent iure? Magni? Porta minus pariatur ante dolore, veniam cubilia urna? Eligendi commodo fugiat voluptate, rerum orci neque voluptatem cum repellendus exercitation pellentesque.
LOAD MOREHigh, vehicula praesent iure? Magni? Porta minus pariatur ante dolore, veniam cubilia urna? Eligendi commodo fugiat voluptate, rerum orci neque voluptatem cum repellendus exercitation pellentesque.
LOAD MOREBlanditiis dapibus, aliquet ullam in ut, conubia turpis dolore vivamus ligula deserunt, vehicula praesent iure? Magni? Porta minus pariatur ante dolore, veniam cubilia urna? Eligendi commodo fugiat voluptate, rerum orci neque voluptatem cum repellendus exercitation pellentesque.
LOAD MORE


JUMP!
TELEPORT!
DUCK!
 Oh No!
Luckily, your home is just down the street.
Select 'Easy' for on screen instructions!
Your score is:
Select difficulty to play again!
0
Up
Hold Spacebar
Down


[Knight 'Igrit' is requesting your permission to advance his grade . ].
[Will you permit the advancement?].
'Permission to advance?'.
Surprised by the never-before-seen System message, Jin-Woo quickly confirmed Igrit's information to make sure
[Igrit Lv . Max].
Knight grade
It's now possible to advance the grade after the level requirement has been met . Will advance to the next grade when the Sovereign gives his permission
'Igrit's level . ??'.
The level that previously hovered around the 30 mark had changed to 'Max' before he had noticed it . It must've been the case that, once the Shadow Soldier's level cap had been met, he'd be given an opportunity to advance to the next grade
'Is the requirement level for advancement somewhere between the late thirties and early forties?'.
When taking into account the potential level-ups happening during a single battle, he suspected that the required level had to be around there somewhere
Considering that the average level of the Shadow Soldiers was still around the early twenties, it sure as heck felt like a cumbersome requirement
'Besides all that, it also needs my consent, too . '.
That must've been the reason why Jin-Woo thought there were hints of unknown but earnest yearning in Igrit's eyes as he ran over here
'… . '.
Igrit didn't raise his lowered head at all
Jin-Woo could even sense a nervous determination emanating from Igrit as he waited for his lord's decision without budging an inch from his kneeling position
Jin-Woo was even tempted to pat the dude on the shoulder and praise him for the job well done
'This guy '.
Jin-Woo's gaze shifted back to the System message
[Will you permit the advancement?].
The message was blinking slowly as if to urge him for an answer
Igrit was one of the very first to become his Shadow Soldiers, not to mention one who fought the hardest until now, as well . Was there a reason not to allow the grade advancement here?.
Without a shred of hesitation, Jin-Woo replied to the System's message
"I allow it . ".
[Please designate the command phrase . ].
'I need a command phrase for something like this, too?'.
Jin-Woo frowned briefly, but changed his mind just as quick
'Oh, well . '.
Quite a few became Shadow Soldiers at the same time . For today, it was only Igrit, but if more than a few soldiers requested him for the advancement permission at the same time in the near future, then it might become rather tedious and time consuming to answer their call one by one . Especially so, if it happened during the middle of a fight
The command phrase would prove to be useful on those occasions, that's for sure . After a short deliberation, Jin-Woo spoke up
"Permitted . ".
He went with the 'Simple is best' mantra
As soon as the command phrase was set, changes rapidly took place . It began from beneath Igrit's feet
Wuuuaaahhh-!!.
Accompanied by screams coming from a distant place, countless black hands emerged from Igrit's shadow and they grabbed onto every part of him
'What's this?'.
Jin-Woo observed in great interest the unfolding process of the advancement . At first, he thought that those black hands would drag Igrit back into the shadow, but in reality, the opposite happened, instead
The hands holding onto Igrit turned into black smoke and spun around him quite ferociously, before getting absorbed by him . It was as if Igrit was absorbing the black smoke voluntarily
Psuuuuuaaahhk!.
Igrit emerged from the dissipating black smoke while emitting a far greater aura than ever before
Tti-ring
The System message informed Jin-Woo of the results
[The current grade of Knight 'Igrit' has advanced from 'Knight grade' to 'Elite Knight grade' . ].
'Niiice!'.
Jin-Woo did his best to calm his trembling heart and rechecked Igrit's information window
[Igrit Lv . 1].
Elite Knight grade.
'His level has been reset, but his current grade is the same as Fangs now . '.
Before joining Jin-Woo's army of the Shadow Soldiers recently, Fangs used to be the boss monster of a rank A dungeon . Now that Igrit was on the same grade as a creature that powerful, it could only mean that his abilities had grown by that great a deal now
Ba-dump
Jin-Woo's heart beat faster . The theory he came up with back when he became the Shadow Sovereign turned out to be correct
'It wasn't just me who can get stronger . '.
Jin-Woo's gaze swept over each of his Shadow Soldiers
'All these guys are growing stronger alongside me, too . '.
After Igrit changed so noticeably through the grade advancement, he was reminded once more of his soldiers' capability for growth . He was now beset with the desire to urgently raise the levels of other soldiers and have them advance to the next grade as soon as possible
'Looks like one more thing has been added to my to-do list, huh?'.
And so, as he stood there checking out his soldiers while feeling rather satisfied with himself .
From afar, he spotted Tank quickly approaching closer with a dead body of a demon that escaped a little while ago in his jaw
'Uh?'.
However, the light shining in Tank's eyes as he hurriedly ran closer also seemed rather suspicious, too . Those eyes, that aura .
Jin-Woo quietly stared, before asking aloud with a disbelieving expression on his face
"Even you?!".
Tank finally stopped right in front of Jin-Woo's nose and quickly discarded the corpse he worked so hard to bring here . He then began prostrating as well, with his front legs gathered together before his head
"Wuuong . ".
And sure enough, another message popped up in Jin-Woo's view
Tti-ring
[Elite 'Shadow Beast Soldier' is requesting for permission to advance his grade . ].
[Will you permit the advancement?].
'… . Holy cow . '.
Jin-Woo facepalmed in surprise . A quick confirmation of Tank's information revealed that his level had also reached the cap as well
[Shadow Beast Soldier Lv . Max].
Elite grade.
It's now possible to advance the grade after the level requirement has been met . Will advance to the next grade when the Sovereign gives his permission
'Wait a minute '.
Jin-Woo found this rather odd
Unlike the tireless battle machine named Igrit, who started off as a level 7 and maintained his sky-high level until now, Tank was still a far away from meeting the level cap that Jin-Woo suspected to be the advancement requirement
Yet, both Igrit and Tank were about to advance around the same time?.
The difference in these two guys' levels wasn't something that could be bridged by this one battle alone
'Could it be the required level is different for each grade?'.
If so, then it made sense
He thought that since Tank was an 'Elite' rank, his level cap would be lower which meant his advancement would be faster; on the other hand, Igrit and his 'Knight' grade needed more time to advance
If that was the case, then indeed it was possible for the timing of their advancements to match so coincidentally like this
When Jin-Woo's thoughts reached this point, a certain possibility suddenly entered his mind
'Wait, if I reach the right level, could I advance in grade, too?'.
It was just that the required level was so high that he hadn't reached it yet
'… . Eiii, there's no way . '.
Jin-Woo smirked to himself . At the same time, he allowed the advancement to commence
"Permitted . ".
As soon as his permission left his lips, the same type of process as Igrit took place with Tank as well . Hands emerged from the shadow, changed to smoke, and got absorbed into Tank
Shuuaahhak .
And just like Igrit, Tank also became a realm stronger than before
[The current grade of Elite 'Shadow Beast Soldier' has advanced from 'Elite grade' to 'Knight grade' . ].
However, there were some differences, too
Tti-ring, tti-ring, tti-ring
The mechanical beep went off continuously and System messages popped up one after another
[You can bestow a name to a soldier with Knight grade or above . ].
[The bestowed name will be maintained until the Shadow Soldier is dismissed . ].
[Please assign the soldier's name . ].
Tank was a temporary name Jin-Woo came up with on a whim
Since a name couldn't be assigned unless a soldier was a Knight grade, Tank's official moniker had been stuck as a 'Shadow Beast Soldier' . If it weren't for his twice-as-huge frame compared to other bears, there was no way to differentiate Tank from the others
But now, Jin-Woo could freely assign a name now
A deep smile formed on his face
"Tank . ".
[Will you assign it as 'Tank'?].
"I will . ".
When Jin-Woo confirmed it, the information on the 'Shadow Beast Soldier' changed
[Tank Lv . 1].
Knight grade
Perhaps he knew that the advancement process had ended, Tank raised his body up . Standing on his hind legs, he was as tall as a regular two-story house now . Jin-Woo wholeheartedly praised him
"You finally have a name now, Tank . ".
Feeling pleased, Tank raised its head up high and roared out loudly
"You guys all did well . ".
So, time to take a well-deserved break until the next floor
Jin-Woo recalled his soldiers back into his shadow, and while doing that, he couldn't help but spot Iron and his drooping shoulders . The poor guy was the only one out of the 'old' members to not get an advancement today
Shururu .
After his soldiers disappeared as shadows, Jin-Woo left the castle . Esil was waiting for him outside with a rather haggard face
"E-excuse me, Sir Jin-Woo?".
"I told you, stop calling me a Sir . ".
"Y-yes . ".
Esil hesitated somewhat after Jin-Woo curtly replied to her, but eventually, she spoke again
"Excuse me Uhm, Jin-Woo . sir . ".
The demons were a lot more 'sensitive' towards one's seniority than expected, it seemed
" Fine . What now?".
"Do you know how many clans have ceased to exist by your hands?".
Currently, they were on the 89th floor
Esil's clan was on the 80th, so that would make nine clans?.
What with her witnessing a clan being killed off every time they climbed up a floor, Esil had finally grown too anxious to remain silent
"Clans of superior aristocrats are managing the floors 90 and above . They are on another level compared to the upper aristocrats you've encountered so far . ".
Jin-Woo didn't slow down his steps, but still asked her anyway
"Okay, so what?".
"How about resolving the matters with dialogue from now on? If you talk to them nicely, they might hand over the Entry Permit like my cla ".

That human wouldn't have been able to return home alive
"That's how it is . ".
Jin-Woo smirked deeply
Whether it was a monster from a regular dungeon, or a monster from instant dungeons, the relationship with humans would go only as far
'The strong will devour the weak . '.
Jin-Woo agreed with that concept . Besides, he was urgently pressed for both the Entry Permits and the level-ups, so he wasn't planning to give up on either of those
'… . '.
Jin-Woo glanced at Esil to his side
He found her continued silence and the expression of dejection strange and asked her about it
"I thought it'd be a good thing for your people if other clans were destroyed?".
"Pardon?".
"Didn't you say that demon clans are bitterly contesting with one another on the hierarchy or whatever?".
"Ah, that That is true . However ".
From here onwards, they were stepping into the territories of the superior aristocrats
If Jin-Woo failed in his conquest for some reason, then the fury of those superior aristocrats would be directed in full towards her and her own clan . Esil was worried about that
Regardless of her worries, Jin-Woo spoke up confidently
"I'll make your Radish Clan as the number one on the pecking order . ".
'… . But, our clan is Radiru, you know . '.
Esil could only complain meekly in her mind
Soon, they would be stepping into the upper floor .
'… Eiii, I don't care anymore . '.
She had taken on the task of being his guide, so all she had to do was to do her job properly . Esil decided to give up on sweating over it
'Ah, I almost forgot '.
Still, there was this one thing she just had to ask
"Excuse me, Jin-Woo sir".
"Yeah?".
Jin-Woo looked back at her
Having witnessed Jin-Woo continuously destroy other demon clans so easily, she found it pretty scary to meet his eyes anymore, so Esil quickly lowered her gaze to her feet and asked
"Why did you spare my clan?".
Without a doubt, the Radiru Clan would never be able to oppose this man's quest . She knew her clan's military might the best, and now that she had witnessed Jin-Woo's true power, she was sure of this fact
Even then, her Radiru clan emerged relatively unscathed from this merciless man's onslaught . Why was that? She was really curious
Jin-Woo entered the floor-transfer magic circle and turned around to face Esil
"Cuz I find you likeable . ".
Even though she was a monster, she knew when to surrender, she knew when to negotiate, and most importantly, offered up quite a bit of useful information, too
"P-p-pardon me?!".
Esil flinched grandly in surprise, and her neck rapidly dyed in a crimson colour . She stood on the spot hesitating as she fidgeted with her fingers in a clear fluster . Their schedule had been affected by her being rooted to the spot like that, so Jin-Woo asked her to get a move on
"Aren't you coming?".
Then, he glanced at the System message asking him which floor he'd like to go
"If you don't get in now, we'll go back to the 80th floor, okay?".
"I-I'm sorry . ".
Her face still blushing deeply in red, Esil hurriedly entered the magic circle
'… . '.
However, she couldn't raise her head again even after arriving on the next floor
***.
The Incheon International Airport
The representatives from the Japanese Hunter Association arrived in South Korea to discuss the matters of Jeju Island's ant problem . They already had set up a conference with the Korean counterparts
Along with the Japanese Hunter Association's President Matsumoto Shigeo, Japan's number one Hunter, the rank S Goto Ryuji stepped into the airport . (TL note at the end).
The atmosphere within the airport seemed a bit chaotic, so Matsumoto Shigeo took a look around to see what was what
"What's happening here?".
" . There is a very powerful presence nearby . ".
"Stronger than you?".
Goto Ryuji smirked derisively
Seeing the fully-confident face of Goto Ryuji, Matsumoto Shigeo didn't bother to ask anymore
'There's no way South Korea can produce someone like that . '.
Not too long after that, an employee from the Korean Hunters Association hurriedly ran forward to greet and received them
"I'm terribly sorry . I was delayed by all the chaos unfolding inside the airport at the moment . ".
The employee hurriedly lowered his head in apology . Matsumoto Shigeo hid his dissatisfaction expertly and formed a magnanimous smile
"It's fine . However, is there something going on at the airport?".
"Ah, that It's nothing serious, sir . It's just that a Hunter from the United States has arrived just now . ".
"What brings an American Hunter to South Korea?".
"I hear that it's a personal matter, sir . I'm sure that there's nothing to worry about . ".
The employee thought the Association President Matsumoto Shigeo was worried about a possible dungeon break and did his best to assuage the Japanese group's fears
Unfortunately, Matsumoto Shigeo's expression remained dark
'A Hunter from America, is it I hope this person won't interfere with our business here . '.
Goto Ryuji's gaze was fixed in the direction of the noisy crowd of people over yonder . Most likely, that's where the American Hunter was
Meanwhile, Matsumoto Shigeo confirmed the time
If he were to make it to the conference on time, he needed to get going now
Matsumoto Shigeo spoke
"Let's go . ".
< Chapter 105 > Fin


Tables over all the steps in the stitching pipeline to see where most execution time is spent. This is of course different from system to system and from browser to browser, still it is interesting to see the performance difference.
Because the javascript is single threaded, execution and page rendering are done in the same execution thread, which means that while the RANSAC or matching code is executing the browser will not be redrawing the page. It will lock up, and interfere with the user interface. Even if I redraw the page within the for loop (of RANSAC or the matching) it will not be updated until the loop terminates. I have created a test where I force the page to be updated dynamically but every time this occurrence we lose abut 200ms (from the matching or ransac execution). And to implement this inside a loop wold not be very nice. A solution to this could be webworkers.
Stitch the two example images together to one and the same image


No Way!!! John Legend Cannot Be The Sexiest Man Alive - Wendy Williams
by Peace FM OnlineWendy Williams congratulated John Legend on his Sexiest Man Alive win on Wednesday morning by suggesting someone else should have gotten the cover.
Showing the People magazine photo to her studio audience, Williams said that while the crooner was "cute," he's "not the Sexiest Man Alive." Much of her audience agreed with her.
"I think they're a cute couple," she continued, speaking about Legend and wife Chrissy Teigen. "Like, they're short and they're thin. I love them together, but not apart."
Featured Video


Context-based XPath implementation This software is in Public Domain. IT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. Please send bug reports and comments to<EMAIL_ADDRESS>Kirill Lisovsky<EMAIL_ADDRESS>Dmitry Lizorkin <nodeset> ::= ( <nodeset-member>* ) <nodeset-member> ::= <node> | <context> <context> ::= ( *CONTEXT* <node> <ancestor>* ) <node> - an SXML node (a context node) <ancestor>* - context node's parent, grandparent, grandgrandparent etc. A CONTEXT doesn't contain more ANCESTORs than actually required for evaluating the location path. This is achieved by means of an "intellectual" parsing of the location path. The number of ANCESTORs stored in the CONTEXT can differ for different path steps.
A fast however unsafe predicate Assumes that the 'node' provided is a pair
Safer predicate
Fast however unsafe accessors Assume that the argument is the proper context
Safe accessors Can be applied to both a context and an ordinary node
Given a context-set, converts it to a nodeset
Constructor
A smarter constructor Makes context only when required, with the 'num-anc' required
Provided a 'nodeset' of sibling nodes, wraps each into context If 'ancestors' is empty, keeps 'nodeset' unchanged
Complexity results from #f as a value for num-ancestors (which means that the number of ancestors is infinite)
Minus, with the result that is always non-negative
Similar to R5RS 'list-tail' but returns the new list consisting of the first 'k' members of 'lst' If k>(length lst) or k=#f, lst is returned NOTE1: k=#f is used in this implementation to represent positive infinity NOTE2: Unless k=#f, the result is always a newly allocated list. This is the main methodological difference between this function and R5RS 'list-tail'
Returns the last member of the list It is an error for the list to be empty
Constructs the (listof value), whose length is num
Similar to txp:signal-semantic-error, but returns #f
The top of the SXML document?
Removes eq duplicates from the nodeset
Reaches the root of the root of the contextset Result: nodeset
Recovers context for each node of the nodeset Context recovery is performed in its usual technique: searching from the root of the document. As a result, this function can be fairly slow. In this implementation, it is sometimes called after an XPath 'id' function, for location paths like "id(name)/.." By nature of 'id-index', context is lost when we access elements by their ID. It may be a good idea to rework the structure of 'id-index' to make it more suitable for purposes of this context-based XPath implementation. A good news is that only a few elements are usually selected by XPath 'id' function, thus the overhead of searching from the root node might be acceptable in this case.
Makes a context-set from a nodeset supplied, with the num-anc required ancestors-set ::= (listof ancestors) ancestors ::= (listof node) Members of the nodeset are known to be descendants-or-selves of (map car ancestors-set)
Implementation is based on the concept of context Compared to "general" SXPath, a new optional argument was added: NUM-ANCESTORS - number of node's ancestors that will be required later in the location path. For example, NUM-ANCESTORS=1 means that the node's parent only must be remembered in the CONTEXT, grandparents will not be required
Ancestor axis
Ancestor-or-self axis
Attribute axis Borrows much from draft:child
Child axis
Descendant axis
Descendant-or-self axis
Following axis
Following-sibling axis
Namespace axis Borrows much from draft:child
Parent axis
Preceding axis
Preceding-sibling axis
Self axis num-ancestors is not used here
last()
position()
count(node-set)
id(object)
local-name(node-set?)
namespace-uri(node-set?)
name(node-set?)
string(object?)
concat(string, string, string*)
starts-with(string, string)
contains(string, string)
substring-before(string, string)
substring-after(string, string)
substring(string, number, number?)
string-length(string?)
normalize-space(string?)
translate(string, string, string)
boolean(object)
not(boolean)
true()
false()
lang(string)
number(object?)
sum(node-set)
floor(number)
ceiling(number)
round(number)
AST is considered to be properly formed
{5} <AxisSpecifier> ::= (axis-specifier <AxisName> ) {6} <AxisName> ::= (ancestor) | (ancestor-or-self) | (attribute) | (child) | (descendant) | (descendant-or-self) | (following) | (following-sibling) | (namespace) | (parent) | (preceding) | (preceding-sibling) | (self) | (arc) ; the following 3 are added by SXLink | (traverse) | (traverse-arc) Returns: (list lambda num-ancestors pass-vars?) pass-vars? - a boolean: whether var-bindings must be passed to the axis
{7} <NodeTest> ::= (node-test (*)) | (node-test (namespace-uri <String> )) | (node-test (namespace-uri <String> )? (local-name <String> )) | (node-test (comment)) | (node-test (text)) | (node-test (pi <String>? )) | (node-test (point)) | (node-test (range)) + added by sxpath native syntax: | (node-test (equal? <SXML-node> )) | (node-test (eq? <SXML-node> )) | (node-test (names <String>+ )) | (node-test (not-names <String>+ ))s
op - S-expression which represents the operation num-anc - how many ancestors are required in the context after that operation and returns either #f, which signals of a semantic error, or (cons (lambda (nodeset position+size var-binding) ...) num-anc-it-requires) position+size - the same to what was called 'context' in TXPath-1
{1} <LocationPath> ::= <RelativeLocationPath> | <AbsoluteLocationPath>
{2} <AbsoluteLocationPath> ::= (absolute-location-path <Step>* )
{3} <RelativeLocationPath> ::= (relative-location-path <Step>+ )
{4} <Step> ::= (step <AxisSpecifier> <NodeTest> <Predicate>* ) | (range-to (expr <Expr>) <Predicate>* )
{4a} ( <Step>+ ) Returns (cons (listof step-impl) num-anc) or #f
{8} <Predicate> ::= (predicate <Expr> ) NOTE: num-anc is dummy here, since it is always 0 for Predicates
{8a} ( <Predicate>+ ) Returns (cons (listof pred-impl) num-anc) or #f NOTE: num-anc is dummy here, since it is always 0 for Predicates
{9} <Expr> ::= <OrExpr> | <AndExpr> | <EqualityExpr> | <RelationalExpr> | <AdditiveExpr> | <MultiplicativeExpr> | <UnionExpr> | <PathExpr> | <FilterExpr> | <VariableReference> | <Literal> | <Number> | <FunctionCall> | <LocationPath>
{10} <OrExpr> ::= (or <Expr> <Expr>+ ) NOTE: num-anc is dummy here, since it is always 0 for OrExpr
{11} <AndExpr> ::= (and <Expr> <Expr>+ ) NOTE: num-anc is dummy here, since it is always 0 for AndExpr
{12} <EqualityExpr> ::= (= <Expr> <Expr> ) | (!= <Expr> <Expr> ) NOTE: num-anc is dummy here, since it is always 0 for EqualityExpr
{13} <RelationalExpr> ::= (< <Expr> <Expr> ) | (> <Expr> <Expr> ) | (<= <Expr> <Expr> ) | (>= <Expr> <Expr> ) NOTE: num-anc is dummy here, since it is always 0 for RelationalExpr
{14} <AdditiveExpr> ::= (+ <Expr> <Expr> ) | (- <Expr> <Expr>? ) NOTE: num-anc is dummy here, since it is always 0 for AdditiveExpr
{15} <MultiplicativeExpr> ::= (* <Expr> <Expr> ) | (div <Expr> <Expr> ) | (mod <Expr> <Expr> ) NOTE: num-anc is dummy here, since it is always 0 for MultiplicativeExpr
{16} <UnionExpr> ::= (union-expr <Expr> <Expr>+ )
{17} <PathExpr> ::= (path-expr <FilterExpr> <Step>+ )
{18} <FilterExpr> ::= (filter-expr (primary-expr <Expr> ) <Predicate>* )
{19} <VariableReference> ::= (variable-reference <String> )
{20} <Literal> ::= (literal <String> )
{21} <Number> :: (number <Number> )
{22} <FunctionCall> ::= (function-call (function-name <String> ) (argument <Expr> )* )
{22a} ( (argument <Expr> )* ) na-lst - number of ancestors required for each of the arguments Returns: (listof expr-impl) or #f
{25} <XPointer> ::= <ChildSeq> | <FullXPtr> | <Expr>
{26} <ChildSeq> ::= (child-seq (name <String> )) | (child-seq (name <String> )? (number <Number> )+ )
{26a} ( (number <Number> )+ ) Returns (cons (listof sxpath-converter) num-anc) or #f
{27} <FullXPtr> ::= (full-xptr <Expr> <Expr>+ )
xpath-string - an XPath location path (a string) ns+na - can contain 'ns-binding' and/or 'num-ancestors' and/or none of them ns-binding - declared namespace prefixes (an optional argument) ns-binding ::= (listof (prefix . uri)) prefix - a symbol uri - a string num-ancestors - number of ancestors required for resulting nodeset. Can generally be omitted and is than defaulted to 0, which denotes a _usual_ nodeset. If a negative number, this signals that all ancestors should be remembered in the context Returns: (lambda (nodeset position+size var-binding) ...) position+size - the same to what was called 'context' in TXPath-1 var-binding - XPath variable bindings (an optional argument) var-binding = (listof (var-name . value)) var-name - (a symbol) a name of a variable value - its value. The value can have the following type: boolean, number, string, nodeset. NOTE: a node must be represented as a singleton nodeset
Given a list of arguments, returns (values ns-binding num-anc)
Helper for constructing several highest-level API functions
Aliases
A fast however unsafe predicate Assumes that the 'node' provided is a pair
(define (sxml:context-u? node) (eq? (car node) '*CONTEXT*))
Safer predicate
(define (sxml:context? node) (and (pair? node) (eq? (car node) '*CONTEXT*)))
Similar to R5RS 'list-tail' but returns the new list consisting of the first 'k' members of 'lst' If k>(length lst) or k=#f, lst is returned NOTE1: k=#f is used in this implementation to represent positive infinity NOTE2: Unless k=#f, the result is always a newly allocated list. This is the main methodological difference between this function and R5RS 'list-tail'
(define (draft:list-head lst k) (letrec ((list-head (lambda (lst k) (if (or (null? lst) (zero? k)) '() (cons (car lst) (list-head (cdr lst) (- k 1))))))) (if k (list-head lst k) lst)))
Returns the last member of the list It is an error for the list to be empty
(define (draft:list-last lst) (if (null? (cdr lst)) (car lst) (draft:list-last (cdr lst))))
Constructs the (listof value), whose length is num
(define (draft:make-list value num) (if (= num 0) '() (cons value (draft:make-list value (- num 1)))))
Similar to txp:signal-semantic-error, but returns #f
(define (draft:signal-semantic-error . text) (apply txp:signal-semantic-error text) #f)
The top of the SXML document?
(define (draft:top? node) (and (pair? node) (eq? (car node) '*TOP*)))
Removes eq duplicates from the nodeset
(define (draft:remove-eq-duplicates nodeset) (cond ((null? nodeset) nodeset) ((memq (car nodeset) (cdr nodeset)) (draft:remove-eq-duplicates (cdr nodeset))) (else (cons (car nodeset) (draft:remove-eq-duplicates (cdr nodeset))))))
Reaches the root of the root of the contextset Result: nodeset
(define (draft:reach-root contextset) (let ((nodeset (map (lambda (node) (if (sxml:context? node) (draft:list-last (sxml:context->ancestors-u node)) node)) contextset))) (if (or (null? nodeset) (null? (car nodeset))) ; (length nodeset)<=1 nodeset (draft:remove-eq-duplicates nodeset))))
Recovers context for each node of the nodeset Context recovery is performed in its usual technique: searching from the root of the document. As a result, this function can be fairly slow. In this implementation, it is sometimes called after an XPath 'id' function, for location paths like "id(name)/.." By nature of 'id-index', context is lost when we access elements by their ID. It may be a good idea to rework the structure of 'id-index' to make it more suitable for purposes of this context-based XPath implementation. A good news is that only a few elements are usually selected by XPath 'id' function, thus the overhead of searching from the root node might be acceptable in this case.
(define (draft:recover-contextset nodeset root-node num-anc) (map (lambda (node) (draft:smart-make-context node (((sxml:ancestor (lambda (x) #t)) root-node) node) num-anc)) nodeset))
Ancestor axis
(define (draft:ancestor test-pred? . num-ancestors) (let* ((num-anc (if (null? num-ancestors) 0 (car num-ancestors))) (this-axis (lambda (node) ; not a nodeset (if (sxml:context? node) (let loop ((ancs-to-view (sxml:context->ancestors-u node)) (res '())) (cond ((null? ancs-to-view) ; processed everyone (reverse res) ; reverse document order required ) ((test-pred? (car ancs-to-view)) ; can add it to result (loop (cdr ancs-to-view) (cons (draft:smart-make-context (car ancs-to-view) (cdr ancs-to-view) num-anc) res))) (else ; current node doesn't satisfy the predicate (loop (cdr ancs-to-view) res)))) '() ; no ancestors )))) (lambda (node) ; node or nodeset (if (nodeset? node) (map-union this-axis node) (this-axis node)))))
Ancestor-or-self axis
(define (draft:ancestor-or-self test-pred? . num-ancestors) (let* ((num-anc (if (null? num-ancestors) 0 (car num-ancestors))) (this-axis (lambda (node) ; not a nodeset (cond ((sxml:context? node) (let loop ((ancs-to-view (sxml:context->content-u node)) (res '())) (cond ((null? ancs-to-view) ; processed everyone (reverse res) ; reverse document order required ) ((test-pred? (car ancs-to-view)) ; can add it to result (loop (cdr ancs-to-view) (cons (draft:smart-make-context (car ancs-to-view) (cdr ancs-to-view) num-anc) res))) (else ; current node doesn't satisfy the predicate (loop (cdr ancs-to-view) res))))) ; ordinary SXML node ((test-pred? node) ; satisfies the predicate (list node)) (else '()))))) (lambda (node) ; node or nodeset (if (nodeset? node) (map-union this-axis node) (this-axis node)))))
Attribute axis Borrows much from draft:child
(define (draft:attribute test-pred? . num-ancestors) (let* ((num-anc (if (null? num-ancestors) 0 (car num-ancestors))) (this-axis (lambda (node) ; not a nodeset (cond ((not (pair? node)) '()) ; no attributes ; (car node) is always a symbol ((sxml:context-u? node) ; a context node (draft:siblings->context-set ((sxml:filter test-pred?) (sxml:attr-list (sxml:context->node-u node))) (draft:list-head (sxml:context->content-u node) num-anc))) (else ; an ordinary node, and is a pair (draft:siblings->context-set ((sxml:filter test-pred?) (sxml:attr-list node)) (draft:list-head (list node) num-anc))))))) (lambda (node) ; node or nodeset (if (nodeset? node) (map-union this-axis node) (this-axis node)))))
Child axis
(define (draft:child test-pred? . num-ancestors) (let* ((num-anc (if (null? num-ancestors) 0 (car num-ancestors))) (this-axis (lambda (node) ; not a nodeset (cond ((not (pair? node)) '()) ; no children ; (car node) is always a symbol ((sxml:context-u? node) ; a context node (draft:siblings->context-set ((select-kids test-pred?) (sxml:context->node-u node)) (draft:list-head (sxml:context->content-u node) num-anc))) ; an ordinary node, and is a pair ((memq (car node) '(*PI* *COMMENT* *ENTITY*)) '()) (else (draft:siblings->context-set ((sxml:filter test-pred?) (cdr node)) ; like in 'select-kids' (draft:list-head (list node) num-anc))))))) (lambda (node) ; node or nodeset (if (nodeset? node) (map-union this-axis node) (this-axis node)))))
Descendant axis
(define (draft:descendant test-pred? . num-ancestors) (let* ((num-anc (if (null? num-ancestors) 0 (car num-ancestors))) (child (draft:child sxml:node? num-anc)) (this-axis (lambda (node) ; not a nodeset (let rpt ((res '()) (more (child node))) (if (null? more) (reverse res) (rpt (if (test-pred? (sxml:context->node (car more))) (cons (car more) res) res) (append (child (car more)) (cdr more)))))))) (lambda (node) ; node or nodeset (if (nodeset? node) (map-union this-axis node) (this-axis node)))))
Descendant-or-self axis
(define (draft:descendant-or-self test-pred? . num-ancestors) (let* ((num-anc (if (null? num-ancestors) 0 (car num-ancestors))) (child (draft:child sxml:node? num-anc)) (this-axis (lambda (node) ; not a nodeset (let rpt ((res '()) (more (list node))) (if (null? more) (reverse res) (rpt (if (test-pred? (sxml:context->node (car more))) (cons (car more) res) res) (append (child (car more)) (cdr more)))))))) (lambda (node) ; node or nodeset (if (nodeset? node) (map-union this-axis node) (this-axis node)))))
Following axis
(define (draft:following test-pred? . num-ancestors) (let* ((num-anc (if (null? num-ancestors) 0 (car num-ancestors))) (descend (draft:descendant-or-self test-pred? num-anc)) (this-axis (lambda (node) ; not a nodeset (if (sxml:context? node) (let loop ((curr-node (sxml:context->node-u node)) (ancs-to-view (sxml:context->ancestors-u node)) (res '())) (if (null? ancs-to-view) ; processed everyone res (loop (car ancs-to-view) (cdr ancs-to-view) (append res (descend (draft:siblings->context-set (cond ((memq curr-node (cdr ; parent is an element => cdr gives its children (car ancs-to-view))) => cdr) (else ; curr-node is an attribute node ((select-kids sxml:node?) (car ancs-to-view)))) (draft:list-head ancs-to-view num-anc))))))) '() ; no following members )))) (lambda (node) ; node or nodeset (if (nodeset? node) (map-union this-axis node) (this-axis node)))))
Following-sibling axis
(define (draft:following-sibling test-pred? . num-ancestors) (let* ((num-anc (if (null? num-ancestors) 0 (car num-ancestors))) (this-axis (lambda (node) ; not a nodeset (if (and (sxml:context? node) (not (null? (sxml:context->ancestors-u node)))) (cond ((memq (sxml:context->node-u node) (cdr ; parent is an element => cdr gives its children (car (sxml:context->ancestors-u node)))) => (lambda (foll-siblings) (draft:siblings->context-set ((sxml:filter test-pred?) (cdr foll-siblings)) (draft:list-head (sxml:context->ancestors-u node) num-anc)))) (else ; no following siblings '())) '() ; no parent => no siblings )))) (lambda (node) ; node or nodeset (if (nodeset? node) (map-union this-axis node) (this-axis node)))))
Namespace axis Borrows much from draft:child
(define (draft:namespace test-pred? . num-ancestors) (let* ((num-anc (if (null? num-ancestors) 0 (car num-ancestors))) (this-axis (lambda (node) ; not a nodeset (cond ((not (pair? node)) '()) ; no namespaces ; (car node) is always a symbol ((sxml:context-u? node) ; a context node (draft:siblings->context-set ((sxml:filter test-pred?) (sxml:ns-list (sxml:context->node-u node))) (draft:list-head (sxml:context->content-u node) num-anc))) (else ; an ordinary node, and is a pair (draft:siblings->context-set ((sxml:filter test-pred?) (sxml:ns-list node)) (draft:list-head (list node) num-anc))))))) (lambda (node) ; node or nodeset (if (nodeset? node) (map-union this-axis node) (this-axis node)))))
Parent axis
(define (draft:parent test-pred? . num-ancestors) (let* ((num-anc (if (null? num-ancestors) 0 (car num-ancestors))) (this-axis (lambda (node) ; not a nodeset (if (and (sxml:context? node) (not (null? (sxml:context->ancestors-u node))) (test-pred? (car (sxml:context->ancestors-u node)))) (draft:smart-make-context (car (sxml:context->ancestors-u node)) (cdr (sxml:context->ancestors-u node)) num-anc) '() ; no parent )))) (lambda (node) ; node or nodeset (if (nodeset? node) (map-union this-axis node) (this-axis node)))))
Preceding axis
(define (draft:preceding test-pred? . num-ancestors) (let* ((num-anc (if (null? num-ancestors) 0 (car num-ancestors))) (descend (draft:descendant-or-self test-pred? num-anc)) (this-axis (lambda (node) ; not a nodeset (if (sxml:context? node) (let loop ((curr-node (sxml:context->node-u node)) (ancs-to-view (sxml:context->ancestors-u node)) (to-descend '())) (cond ((null? ancs-to-view) ; processed everyone (map-union (lambda (node) (reverse (descend node))) to-descend)) ((memq curr-node (reverse ((select-kids sxml:node?) (car ancs-to-view)))) => (lambda (prec-siblings) (loop (car ancs-to-view) (cdr ancs-to-view) (append to-descend (draft:siblings->context-set (cdr prec-siblings) (draft:list-head ancs-to-view num-anc)))))) (else ; no preceding siblings (loop (car ancs-to-view) (cdr ancs-to-view) to-descend)))) '() ; no preceding members )))) (lambda (node) ; node or nodeset (if (nodeset? node) (map-union this-axis node) (this-axis node)))))
Preceding-sibling axis
(define (draft:preceding-sibling test-pred? . num-ancestors) (let* ((num-anc (if (null? num-ancestors) 0 (car num-ancestors))) (this-axis (lambda (node) ; not a nodeset (if (and (sxml:context? node) (not (null? (sxml:context->ancestors-u node)))) (cond ((memq (sxml:context->node-u node) (reverse (cdr ; parent is an element => cdr gives its children (car (sxml:context->ancestors-u node))))) => (lambda (prec-siblings) (draft:siblings->context-set ((sxml:filter test-pred?) (cdr prec-siblings)) (draft:list-head (sxml:context->ancestors-u node) num-anc)))) (else ; no preceding siblings '())) '() ; no parent => no siblings )))) (lambda (node) ; node or nodeset (if (nodeset? node) (map-union this-axis node) (this-axis node)))))
Self axis num-ancestors is not used here
(define (draft:self test-pred? . num-ancestors) (sxml:filter (lambda (node) (test-pred? (sxml:context->node node)))))
{5} <AxisSpecifier> ::= (axis-specifier <AxisName> ) {6} <AxisName> ::= (ancestor) | (ancestor-or-self) | (attribute) | (child) | (descendant) | (descendant-or-self) | (following) | (following-sibling) | (namespace) | (parent) | (preceding) | (preceding-sibling) | (self) | (arc) ; the following 3 are added by SXLink | (traverse) | (traverse-arc) Returns: (list lambda num-ancestors pass-vars?) pass-vars? - a boolean: whether var-bindings must be passed to the axis
(define (draft:ast-axis-specifier op num-anc) (if (not (eq? (car op) 'axis-specifier)) (draft:signal-semantic-error "not an AxisSpecifier - " op) (case (caadr op) ; AxisName ((ancestor) (list draft:ancestor #f #f)) ((ancestor-or-self) (list draft:ancestor-or-self #f #f)) ((attribute) (list draft:attribute (draft:na-minus-nneg num-anc 1) #f)) ((child) (list draft:child (draft:na-minus-nneg num-anc 1) #f)) ((descendant) (list draft:descendant (draft:na-minus-nneg num-anc 1) #f)) ((descendant-or-self) (list draft:descendant-or-self num-anc #f)) ((following) (list draft:following #f #f)) ((following-sibling) (list draft:following-sibling (draft:na-max num-anc 1) #f)) ((namespace) (list draft:namespace (draft:na-minus-nneg num-anc 1) #f)) ((parent) (list draft:parent (draft:na+ num-anc 1) #f)) ((preceding) (list draft:preceding #f #f)) ((preceding-sibling) (list draft:preceding-sibling (draft:na-max num-anc 1) #f)) ((self) (list draft:self num-anc #f)) ((arc) (list xlink:axis-arc #f #f)) ((traverse) (list xlink:axis-traverse #f #t)) ((traverse-arc) (list xlink:axis-traverse-arc #f #t)) (else (draft:signal-semantic-error "unknown AxisName - " op)))))
{7} <NodeTest> ::= (node-test (*)) | (node-test (namespace-uri <String> )) | (node-test (namespace-uri <String> )? (local-name <String> )) | (node-test (comment)) | (node-test (text)) | (node-test (pi <String>? )) | (node-test (point)) | (node-test (range)) + added by sxpath native syntax: | (node-test (equal? <SXML-node> )) | (node-test (eq? <SXML-node> )) | (node-test (names <String>+ )) | (node-test (not-names <String>+ ))s
(define (draft:ast-node-test op) (if (not (eq? (car op) 'node-test)) (draft:signal-semantic-error "not an NodeTest - " op) (case (caadr op) ; NodeTest name ((*) (ntype?? '*)) ((namespace-uri) (cond ((= (length op) 2) ; NodeTest in the form of prefix:* (ntype-namespace-id?? (cadadr op))) ((eq? (caaddr op) 'local-name) (ntype?? (string->symbol (string-append (cadadr op) ":" (cadr (caddr op)))))) (else (draft:signal-semantic-error "improper QName NodeTest - " op)))) ((local-name) (ntype?? (string->symbol (cadadr op)))) ((comment) (ntype?? '*COMMENT*)) ((text) (ntype?? '*text*)) ((pi) (if (= (length (cadr op)) 2) ; PI target supplied (let ((target (string->symbol (cadadr op)))) (lambda (node) (and (pair? node) (eq? (car node) '*PI*) (equal? (cadr node) target)))) (lambda (node) (and (pair? node) (eq? (car node) '*PI*))))) ((node) sxml:node?) ((point) (draft:signal-semantic-error "point() NodeTest is not supported by this implementation")) ((range) (draft:signal-semantic-error "range() NodeTest is not supported by this implementation")) ((equal?) (node-equal? (cadadr op))) ((eq?) (node-eq? (cadadr op))) ((names) (ntype-names?? (cdadr op))) ((not-names) (sxml:complement (ntype-names?? (cdadr op)))) (else (draft:signal-semantic-error "unknown NodeTest - " op)))))
Given a list of arguments, returns (values ns-binding num-anc)
(define (draft:arglist->ns+na arglst) (let loop ((arglst arglst) (ns-binding '()) (num-anc 0)) (cond ((null? arglst) (values ns-binding num-anc)) ((pair? (car arglst)) (loop (cdr arglst) (car arglst) num-anc)) ((number? (car arglst)) (loop (cdr arglst) ns-binding (if (negative? (car arglst)) #f (car arglst)))) (else (loop (cdr arglst) ns-binding num-anc)))))
Helper for constructing several highest-level API functions
(define (draft:api-helper grammar-parser ast-parser) (lambda (xpath-string . ns+na) (call-with-values (lambda () (draft:arglist->ns+na ns+na)) (lambda (ns-binding num-anc) (and-let* ((ast (grammar-parser xpath-string ns-binding)) (impl-lst (ast-parser ast num-anc))) (let ((res (car impl-lst))) (lambda (node . var-binding) ((if (and num-anc (zero? num-anc)) draft:contextset->nodeset (lambda (x) x)) (res (as-nodeset node) (cons 1 1) ;(xlink:add-docs-to-vars ; node (if (null? var-binding) var-binding (car var-binding)) ; ) )))))))))
(define draft:xpath (draft:api-helper txp:xpath->ast draft:ast-location-path))
(define draft:xpointer (draft:api-helper txp:xpointer->ast draft:ast-xpointer))
(define draft:xpath-expr (draft:api-helper txp:expr->ast draft:ast-expr))
(define draft:sxpath (draft:api-helper txp:sxpath->ast draft:ast-expr))
Aliases
(define txpath-with-context draft:xpath)
(define txpath/c draft:xpath)
(define sxpath-with-context draft:sxpath)
(define sxpath/c draft:sxpath)
Fast however unsafe accessors Assume that the argument is the proper context
(define sxml:context->node-u cadr)
(define sxml:context->ancestors-u cddr)
(define sxml:context->content-u cdr)
Safe accessors Can be applied to both a context and an ordinary node
(define (sxml:context->node context) (if (sxml:context? context) (cadr context) context))
(define (sxml:context->ancestors context) (if (sxml:context? context) (cddr context) '()))
(define (sxml:context->content context) (if (sxml:context? context) (cdr context) (list context)))
Given a context-set, converts it to a nodeset
(define (draft:contextset->nodeset obj) (if (nodeset? obj) (map sxml:context->node obj) obj))
Constructor
(define (draft:make-context node ancestors) (cons '*CONTEXT* (cons node ancestors)))
A smarter constructor Makes context only when required, with the 'num-anc' required
(define (draft:smart-make-context node ancestors num-anc) (if (or (and num-anc (zero? num-anc)) (null? ancestors)) node ; no need for context construction (cons '*CONTEXT* (cons node (draft:list-head ancestors num-anc)))))
Provided a 'nodeset' of sibling nodes, wraps each into context If 'ancestors' is empty, keeps 'nodeset' unchanged
(define (draft:siblings->context-set nodeset ancestors) (if (null? ancestors) nodeset (map (lambda (node) (draft:make-context node ancestors)) nodeset)))
(define (draft:na+ na1 na2) (if (or (not na1) (not na2)) ; either argument is infinite #f (+ na1 na2)))
(define (draft:na-minus na value) (if (not na) na (- na value)))
Minus, with the result that is always non-negative
(define (draft:na-minus-nneg na value) (cond ((not na) na) ((< (- na value) 0) 0) (else (- na value))))
(define (draft:na-max . na-lst) (cond ((null? na-lst) 0) ((member #f na-lst) #f) (else (apply max na-lst))))
(define (draft:na-min . na-lst) (if (null? na-lst) 0 (let ((num-lst (filter (lambda (x) x) na-lst))) (if (null? num-lst) #f ; all na-lst consists of #f (apply min num-lst)))))
(define (draft:na> na1 na2) (cond ((not na2) ; second argument in infinite #f) ((not na1) ; first argument is infinite #t) (else ; niether argument is infinite (> na1 na2))))
(define (draft:na>= na1 na2) (cond ((not na2) ; second argument in infinite (not na1)) ((not na1) ; first argument is infinite #t) (else ; niether argument is infinite (>= na1 na2))))
Makes a context-set from a nodeset supplied, with the num-anc required ancestors-set ::= (listof ancestors) ancestors ::= (listof node) Members of the nodeset are known to be descendants-or-selves of (map car ancestors-set)
(define (draft:find-proper-context nodeset ancestors-set num-anc) (map (lambda (node) (if (sxml:context? node) ; already a context node ; nothing to be done (let loop ((this-level ancestors-set) (next-level '())) (if (null? this-level) ; this level fully analyzed (if (null? next-level) ; failed to find node (loop next-level '())) (let ((ancestors (car this-level))) (if (eq? node (car ancestors)) ; proper ancestors found (draft:make-context node (draft:list-head (cdr ancestors) num-anc)) (loop (cdr this-level) (append (map (lambda (n) (cons n ancestors)) ((sxml:child sxml:node?) (car ancestors))) (map (lambda (n) (cons n ancestors)) ((sxml:attribute (lambda (x) #t)) (car ancestors))) next-level)))))))) nodeset))
last()
(define (draft:core-last num-anc) (lambda (nodeset position+size var-binding) (cdr position+size)))
position()
(define (draft:core-position num-anc) (lambda (nodeset position+size var-binding) (car position+size)))
count(node-set)
(define (draft:core-count num-anc arg-func) (lambda (nodeset position+size var-binding) (let ((res (arg-func nodeset position+size var-binding))) (cond ((nodeset? res) (length res)) (else (sxml:xpointer-runtime-error "count() function - an argument is not a nodeset") 0)))))
id(object)
(define (draft:core-id num-anc arg-func) (lambda (nodeset position+size var-binding) (let* ((root-node (draft:reach-root nodeset)) (id-nset ((sxml:child (ntype?? 'id-index)) ((sxml:child (ntype?? '@@)) root-node)))) (if (null? id-nset) ; no id-index '() ; ID function returns an empty nodeset (let ((res ((sxml:id (cdar id-nset)) ; implemented in "sxpath-ext.scm" (draft:contextset->nodeset (arg-func nodeset position+size var-binding))))) (if (and num-anc (zero? num-anc)) ; no ancestors required res (draft:recover-contextset res root-node num-anc)))))))
local-name(node-set?)
(define (draft:core-local-name num-anc . arg-func) ; optional argument (if (null? arg-func) ; no argument supplied (lambda (nodeset position+size var-binding) (let ((nodeset (draft:contextset->nodeset nodeset))) (cond ((null? nodeset) "") ((not (pair? (car nodeset))) "") ; no name (else (let ((name (symbol->string (caar nodeset)))) (cond ((string-rindex name #\:) => (lambda (pos) (substring name (+ pos 1) (string-length name)))) (else ; a NCName name))))))) (let ((func (car arg-func))) (lambda (nodeset position+size var-binding) (let ((obj (draft:contextset->nodeset (func nodeset position+size var-binding)))) (cond ((null? obj) "") ; an empty nodeset ((not (nodeset? obj)) (sxml:xpointer-runtime-error "NAME function - an argument is not a nodeset") "") ((not (pair? (car obj))) "") ; no name (else (let ((name (symbol->string (caar obj)))) (cond ((string-rindex name #\:) => (lambda (pos) (substring name (+ pos 1) (string-length name)))) (else ; a NCName name))))))))))
namespace-uri(node-set?)
(define (draft:core-namespace-uri num-anc . arg-func) ; optional argument (if (null? arg-func) ; no argument supplied (lambda (nodeset position+size var-binding) (let ((nodeset (draft:contextset->nodeset nodeset))) (cond ((null? nodeset) "") ((not (pair? (car nodeset))) "") ; no name (else (let ((name (symbol->string (caar nodeset)))) (cond ((string-rindex name #\:) => (lambda (pos) (substring name 0 pos))) (else ; a NCName ""))))))) (let ((func (car arg-func))) (lambda (nodeset position+size var-binding) (let ((obj (draft:contextset->nodeset (func nodeset position+size var-binding)))) (cond ((null? obj) "") ; an empty nodeset ((not (nodeset? obj)) (sxml:xpointer-runtime-error "NAME function - an argument is not a nodeset") "") ((not (pair? (car obj))) "") ; no name (else (let ((name (symbol->string (caar obj)))) (cond ((string-rindex name #\:) => (lambda (pos) (substring name 0 pos))) (else ""))))))))))
name(node-set?)
(define (draft:core-name num-anc . arg-func) ; optional argument (if (null? arg-func) ; no argument supplied (lambda (nodeset position+size var-binding) (let ((nodeset (draft:contextset->nodeset nodeset))) (cond ((null? nodeset) "") ((not (pair? (car nodeset))) "") ; no name (else (symbol->string (caar nodeset)))))) (let ((func (car arg-func))) (lambda (nodeset position+size var-binding) (let ((obj (draft:contextset->nodeset (func nodeset position+size var-binding)))) (cond ((null? obj) "") ; an empty nodeset ((not (nodeset? obj)) (sxml:xpointer-runtime-error "NAME function - an argument is not a nodeset") "") ((not (pair? (car obj))) "") ; no name (else (symbol->string (caar obj)))))))))
string(object?)
(define (draft:core-string num-anc . arg-func) ; optional argument (if (null? arg-func) ; no argument supplied (lambda (nodeset position+size var-binding) (sxml:string (draft:contextset->nodeset nodeset))) (let ((func (car arg-func))) (lambda (nodeset position+size var-binding) (sxml:string (draft:contextset->nodeset (func nodeset position+size var-binding)))))))
concat(string, string, string*)
(define (draft:core-concat num-anc . arg-func-lst) (lambda (nodeset position+size var-binding) (apply string-append (map (lambda (f) (sxml:string (draft:contextset->nodeset (f nodeset position+size var-binding)))) arg-func-lst))))
starts-with(string, string)
(define (draft:core-starts-with num-anc arg-func1 arg-func2) (lambda (nodeset position+size var-binding) (let ((str1 (sxml:string (draft:contextset->nodeset (arg-func1 nodeset position+size var-binding)))) (str2 (sxml:string (draft:contextset->nodeset (arg-func2 nodeset position+size var-binding))))) (string-prefix? str2 str1))))
contains(string, string)
(define (draft:core-contains num-anc arg-func1 arg-func2) (lambda (nodeset position+size var-binding) (let ((str1 (sxml:string (draft:contextset->nodeset (arg-func1 nodeset position+size var-binding)))) (str2 (sxml:string (draft:contextset->nodeset (arg-func2 nodeset position+size var-binding))))) (if (substring? str2 str1) #t #f) ; must return a boolean )))
substring-before(string, string)
(define (draft:core-substring-before num-anc arg-func1 arg-func2) (lambda (nodeset position+size var-binding) (let* ((str1 (sxml:string (draft:contextset->nodeset (arg-func1 nodeset position+size var-binding)))) (str2 (sxml:string (draft:contextset->nodeset (arg-func2 nodeset position+size var-binding)))) (pos (substring? str2 str1))) (if (not pos) ; STR1 doesn't contain STR2 "" (substring str1 0 pos)))))
substring-after(string, string)
(define (draft:core-substring-after num-anc arg-func1 arg-func2) (lambda (nodeset position+size var-binding) (let* ((str1 (sxml:string (draft:contextset->nodeset (arg-func1 nodeset position+size var-binding)))) (str2 (sxml:string (draft:contextset->nodeset (arg-func2 nodeset position+size var-binding)))) (pos (substring? str2 str1))) (if (not pos) ; STR1 doesn't contain STR2 "" (substring str1 (+ pos (string-length str2)) (string-length str1))))))
substring(string, number, number?)
(define (draft:core-substring num-anc arg-func1 arg-func2 . arg-func3) (if (null? arg-func3) ; no third argument supplied (lambda (nodeset position+size var-binding) (let ((str (sxml:string (draft:contextset->nodeset (arg-func1 nodeset position+size var-binding)))) (num1 (sxml:number (draft:contextset->nodeset (arg-func2 nodeset position+size var-binding))))) (let ((len (string-length str)) (start (- (inexact->exact (round num1)) 1))) (if (> start len) "" (substring str (if (< start 0) 0 start) len))))) (let ((arg-func3 (car arg-func3))) (lambda (nodeset position+size var-binding) (let ((str (sxml:string (draft:contextset->nodeset (arg-func1 nodeset position+size var-binding)))) (num1 (sxml:number (draft:contextset->nodeset (arg-func2 nodeset position+size var-binding)))) (num2 (sxml:number (draft:contextset->nodeset (arg-func3 nodeset position+size var-binding))))) (let* ((len (string-length str)) (start (- (inexact->exact (round num1)) 1)) (fin (+ start (inexact->exact (round num2))))) (if (or (> start len) (< fin 0) (< fin start)) "" (substring str (if (< start 0) 0 start) (if (> fin len) len fin)))))))))
string-length(string?)
(define (draft:core-string-length num-anc . arg-func) ; optional argument (if (null? arg-func) ; no argument supplied (lambda (nodeset position+size var-binding) (string-length (sxml:string (draft:contextset->nodeset nodeset)))) (let ((func (car arg-func))) (lambda (nodeset position+size var-binding) (string-length (sxml:string (draft:contextset->nodeset (func nodeset position+size var-binding))))))))
normalize-space(string?)
(define (draft:core-normalize-space num-anc . arg-func) ; optional argument (if (null? arg-func) ; no argument supplied (lambda (nodeset position+size var-binding) (let rpt ((src (string-split (sxml:string (draft:contextset->nodeset nodeset)) sxml:whitespace)) (res '())) (cond ((null? src) (apply string-append (reverse res))) ((= (string-length (car src)) 0) ; empty string (rpt (cdr src) res)) ((null? res) (rpt (cdr src) (cons (car src) res))) (else (rpt (cdr src) (cons (car src) (cons " " res))))))) (let ((func (car arg-func))) (lambda (nodeset position+size var-binding) (let rpt ((src (string-split (sxml:string (draft:contextset->nodeset (func nodeset position+size var-binding))) sxml:whitespace)) (res '())) (cond ((null? src) (apply string-append (reverse res))) ((= (string-length (car src)) 0) ; empty string (rpt (cdr src) res)) ((null? res) (rpt (cdr src) (cons (car src) res))) (else (rpt (cdr src) (cons (car src) (cons " " res))))))))))
translate(string, string, string)
(define (draft:core-translate num-anc arg-func1 arg-func2 arg-func3) (lambda (nodeset position+size var-binding) (let ((str1 (sxml:string (draft:contextset->nodeset (arg-func1 nodeset position+size var-binding)))) (str2 (sxml:string (draft:contextset->nodeset (arg-func2 nodeset position+size var-binding)))) (str3 (sxml:string (draft:contextset->nodeset (arg-func3 nodeset position+size var-binding))))) (let ((alist (let while ((lst2 (string->list str2)) (lst3 (string->list str3)) (alist '())) (cond ((null? lst2) (reverse alist)) ((null? lst3) (append (reverse alist) (map (lambda (ch) (cons ch #f)) lst2))) (else (while (cdr lst2) (cdr lst3) (cons (cons (car lst2) (car lst3)) alist))))))) (let rpt ((lst1 (string->list str1)) (res '())) (cond ((null? lst1) (list->string (reverse res))) ((assoc (car lst1) alist) => (lambda (pair) (if (cdr pair) (rpt (cdr lst1) (cons (cdr pair) res)) (rpt (cdr lst1) res)))) (else (rpt (cdr lst1) (cons (car lst1) res)))))))))
boolean(object)
(define (draft:core-boolean num-anc arg-func) (lambda (nodeset position+size var-binding) (sxml:boolean (arg-func nodeset position+size var-binding))))
not(boolean)
(define (draft:core-not num-anc arg-func) (lambda (nodeset position+size var-binding) (not (sxml:boolean (arg-func nodeset position+size var-binding)))))
true()
(define (draft:core-true num-anc) (lambda (nodeset position+size var-binding) #t))
false()
(define (draft:core-false num-anc) (lambda (nodeset position+size var-binding) #f))
lang(string)
(define (draft:core-lang num-anc arg-func) (lambda (nodeset position+size var-binding) (let ((arg (sxml:string (draft:contextset->nodeset (arg-func nodeset position+size var-binding)))) (lng ((draft:child (ntype?? '*text*)) ((draft:attribute (ntype?? 'xml:lang)) ((draft:ancestor-or-self (lambda (x) #t)) (car nodeset) ; context-node = (car nodeset) ))))) (and (not (null? lng)) (or (string-ci=? arg (car lng)) (string-prefix-ci? (string-append arg "-") (car lng)))))))
number(object?)
(define (draft:core-number num-anc . arg-func) ; optional argument (if (null? arg-func) ; no argument supplied (lambda (nodeset position+size var-binding) (sxml:number (draft:contextset->nodeset nodeset))) (let ((func (car arg-func))) (lambda (nodeset position+size var-binding) (sxml:number (draft:contextset->nodeset (func nodeset position+size var-binding)))))))
sum(node-set)
(define (draft:core-sum num-anc arg-func) (lambda (nodeset position+size var-binding) (let ((res (arg-func nodeset position+size var-binding))) (cond ((nodeset? res) (apply + (map (lambda (node) (sxml:number (sxml:string-value (sxml:context->node node)))) res))) (else (sxml:xpointer-runtime-error "SUM function - an argument is not a nodeset") 0)))))
floor(number)
(define (draft:core-floor num-anc arg-func) (lambda (nodeset position+size var-binding) (inexact->exact (floor (sxml:number (draft:contextset->nodeset (arg-func nodeset position+size var-binding)))))))
ceiling(number)
(define (draft:core-ceiling num-anc arg-func) (lambda (nodeset position+size var-binding) (inexact->exact (ceiling (sxml:number (draft:contextset->nodeset (arg-func nodeset position+size var-binding)))))))
round(number)
(define (draft:core-round num-anc arg-func) (lambda (nodeset position+size var-binding) (inexact->exact (round (sxml:number (draft:contextset->nodeset (arg-func nodeset position+size var-binding)))))))
{1} <LocationPath> ::= <RelativeLocationPath> | <AbsoluteLocationPath>
(define (draft:ast-location-path op num-anc) (case (car op) ((absolute-location-path) (draft:ast-absolute-location-path op num-anc)) ((relative-location-path) (draft:ast-relative-location-path op num-anc)) (else (draft:signal-semantic-error "improper LocationPath - " op))))
{2} <AbsoluteLocationPath> ::= (absolute-location-path <Step>* )
(define (draft:ast-absolute-location-path op num-anc) (cond ((not (eq? (car op) 'absolute-location-path)) (draft:signal-semantic-error "not an AbsoluteLocationPath - " op)) ((null? (cdr op)) ; no Steps (cons (lambda (nodeset position+size var-binding) (draft:reach-root nodeset)) #f)) (else (and-let* ((steps-res (draft:ast-step-list (cdr op) num-anc))) (cons (if (null? (cdar steps-res)) ; only a single step (let ((step-impl (caar steps-res))) (lambda (nodeset position+size var-binding) (step-impl (draft:reach-root nodeset) position+size var-binding))) (let ((converters (car steps-res))) (lambda (nodeset position+size var-binding) (let rpt ((nset (draft:reach-root nodeset)) (fs converters)) (if (null? fs) nset (rpt ((car fs) nset position+size var-binding) (cdr fs))))))) #f)))))
{3} <RelativeLocationPath> ::= (relative-location-path <Step>+ )
(define (draft:ast-relative-location-path op num-anc) (if (not (eq? (car op) 'relative-location-path)) (draft:signal-semantic-error "not a RelativeLocationPath - " op) (and-let* ((steps-res (draft:ast-step-list (cdr op) num-anc))) (cons (if (null? (cdar steps-res)) ; only a single step (caar steps-res) (let ((converters (car steps-res))) (lambda (nodeset position+size var-binding) (let rpt ((nset nodeset) (fs converters)) (if (null? fs) nset (rpt ((car fs) nset position+size var-binding) (cdr fs))))))) (cdr steps-res)))))
{4} <Step> ::= (step <AxisSpecifier> <NodeTest> <Predicate>* ) | (range-to (expr <Expr>) <Predicate>* )
(define (draft:ast-step op num-anc) (cond ((eq? (car op) 'range-to) (draft:signal-semantic-error "range-to function not implemented")) ((eq? (car op) 'filter-expr) ; can be produced by sxpath (draft:ast-filter-expr op num-anc)) ((eq? (car op) 'lambda-step) ; created by sxpath (cons (let ((proc (cadr op))) (if (and num-anc (zero? num-anc)) ; no ancestors required (lambda (node position+size var-binding) (proc (draft:contextset->nodeset (as-nodeset node)) var-binding)) (lambda (node position+size var-binding) (draft:find-proper-context (proc (draft:contextset->nodeset (as-nodeset node)) var-binding) (append (map sxml:context->content (as-nodeset node)) (apply append ; nodes that can be obtained through var values (map (lambda (pair) (if (nodeset? (cdr pair)) (map sxml:context->content (cdr pair)) '())) var-binding))) num-anc)))) num-anc)) ((eq? (car op) 'step) (if (null? (cdddr op)) ; no Predicates (and-let* ((axis-lst (draft:ast-axis-specifier (cadr op) num-anc)) (ntest (draft:ast-node-test (caddr op)))) (let ((axis ((car axis-lst) ntest num-anc))) (cons (if (caddr axis-lst) ; var-binding is to be passed (lambda (nodeset position+size var-binding) (axis nodeset var-binding)) (lambda (nodeset position+size var-binding) (axis nodeset))) (cadr axis-lst)))) (and-let* ((preds-res (draft:ast-predicate-list (cdddr op) 0)) (axis-lst (draft:ast-axis-specifier (cadr op) (draft:na-max num-anc (cdr preds-res)))) (ntest (draft:ast-node-test (caddr op)))) (let ((axis ((car axis-lst) ntest (draft:na-max num-anc (cdr preds-res)))) (pred-impl-lst (car preds-res))) (cons (if (caddr axis-lst) ; variables are to be passed to the axis (lambda (nodeset position+size var-binding) (map-union (lambda (node) (let loop ((nset (axis node var-binding)) (preds pred-impl-lst)) (if (null? preds) nset (loop ((car preds) nset position+size var-binding) (cdr preds))))) nodeset)) (lambda (nodeset position+size var-binding) (map-union (lambda (node) (let loop ((nset (axis node)) (preds pred-impl-lst)) (if (null? preds) nset (loop ((car preds) nset position+size var-binding) (cdr preds))))) nodeset))) (cadr axis-lst)))))) (else (draft:signal-semantic-error "not a Step - " op))))
{4a} ( <Step>+ ) Returns (cons (listof step-impl) num-anc) or #f
(define (draft:ast-step-list step-lst num-anc) (let loop ((steps-to-view (reverse step-lst)) (res-lst '()) (num-anc num-anc)) (if (null? steps-to-view) ; everyone processed (cons res-lst num-anc) (and-let* ((step-res (draft:ast-step (car steps-to-view) num-anc))) (loop (cdr steps-to-view) (cons (car step-res) res-lst) (cdr step-res))))))
{8} <Predicate> ::= (predicate <Expr> ) NOTE: num-anc is dummy here, since it is always 0 for Predicates
(define (draft:ast-predicate op num-anc) (if (not (eq? (car op) 'predicate)) (draft:signal-semantic-error "not an Predicate - " op) (and-let* ((expr-res (draft:ast-expr (cadr op) 0))) (let ((pred (car expr-res))) (cons (lambda (nodeset position+size var-binding) (if (null? nodeset) ; already empty nodeset ; nothing to filter (let ((size (length nodeset))) ; context size (let loop ((nset nodeset) (res '()) (pos 1)) (if (null? nset) (reverse res) (let ((value (pred (list (car nset)) (cons pos size) var-binding))) (loop (cdr nset) (if (if (number? value) (= value pos) (sxml:boolean value)) (cons (car nset) res) res) (+ pos 1)))))))) (cdr expr-res))))))
{8a} ( <Predicate>+ ) Returns (cons (listof pred-impl) num-anc) or #f NOTE: num-anc is dummy here, since it is always 0 for Predicates
(define (draft:ast-predicate-list op-lst num-anc) (let ((pred-res-lst (map (lambda (op) (draft:ast-predicate op 0)) op-lst))) (if (member #f pred-res-lst) ; error detected #f (cons (map car pred-res-lst) (apply draft:na-max (map cdr pred-res-lst))))))
{9} <Expr> ::= <OrExpr> | <AndExpr> | <EqualityExpr> | <RelationalExpr> | <AdditiveExpr> | <MultiplicativeExpr> | <UnionExpr> | <PathExpr> | <FilterExpr> | <VariableReference> | <Literal> | <Number> | <FunctionCall> | <LocationPath>
(define (draft:ast-expr op num-anc) (case (car op) ((or) (draft:ast-or-expr op num-anc)) ((and) (draft:ast-and-expr op num-anc)) ((= !=) (draft:ast-equality-expr op num-anc)) ((< > <= >=) (draft:ast-relational-expr op num-anc)) ((+ -) (draft:ast-additive-expr op num-anc)) ((* div mod) (draft:ast-multiplicative-expr op num-anc)) ((union-expr) (draft:ast-union-expr op num-anc)) ((path-expr) (draft:ast-path-expr op num-anc)) ((filter-expr) (draft:ast-filter-expr op num-anc)) ((variable-reference) (draft:ast-variable-reference op num-anc)) ((literal) (draft:ast-literal op num-anc)) ((number) (draft:ast-number op num-anc)) ((function-call) (draft:ast-function-call op num-anc)) ((absolute-location-path) (draft:ast-absolute-location-path op num-anc)) ((relative-location-path) (draft:ast-relative-location-path op num-anc)) (else (draft:signal-semantic-error "unknown Expr - " op))))
{10} <OrExpr> ::= (or <Expr> <Expr>+ ) NOTE: num-anc is dummy here, since it is always 0 for OrExpr
(define (draft:ast-or-expr op num-anc) (let ((expr-res-lst (map (lambda (expr) (draft:ast-expr expr 0)) (cdr op)))) (if (member #f expr-res-lst) ; error detected #f (let ((expr-impls (map car expr-res-lst))) (cons (lambda (nodeset position+size var-binding) (let rpt ((fs expr-impls)) (cond ((null? fs) #f) ((sxml:boolean ((car fs) nodeset position+size var-binding)) #t) (else (rpt (cdr fs)))))) (apply draft:na-max (map cdr expr-res-lst)))))))
{11} <AndExpr> ::= (and <Expr> <Expr>+ ) NOTE: num-anc is dummy here, since it is always 0 for AndExpr
(define (draft:ast-and-expr op num-anc) (let ((expr-res-lst (map (lambda (expr) (draft:ast-expr expr 0)) (cdr op)))) (if (member #f expr-res-lst) ; error detected #f (let ((expr-impls (map car expr-res-lst))) (cons (lambda (nodeset position+size var-binding) (let rpt ((fs expr-impls)) (cond ((null? fs) #t) ((not (sxml:boolean ((car fs) nodeset position+size var-binding))) #f) (else (rpt (cdr fs)))))) (apply draft:na-max (map cdr expr-res-lst)))))))
{12} <EqualityExpr> ::= (= <Expr> <Expr> ) | (!= <Expr> <Expr> ) NOTE: num-anc is dummy here, since it is always 0 for EqualityExpr
(define (draft:ast-equality-expr op num-anc) (and-let* ((left-lst (draft:ast-expr (cadr op) 0)) (right-lst (draft:ast-expr (caddr op) 0))) (let ((cmp-op (cadr (assq (car op) `((= ,sxml:equal?) (!= ,sxml:not-equal?))))) (left (car left-lst)) (right (car right-lst))) (cons (lambda (nodeset position+size var-binding) (cmp-op (draft:contextset->nodeset (left nodeset position+size var-binding)) (draft:contextset->nodeset (right nodeset position+size var-binding)))) (draft:na-max (cdr left-lst) (cdr right-lst))))))
{13} <RelationalExpr> ::= (< <Expr> <Expr> ) | (> <Expr> <Expr> ) | (<= <Expr> <Expr> ) | (>= <Expr> <Expr> ) NOTE: num-anc is dummy here, since it is always 0 for RelationalExpr
(define (draft:ast-relational-expr op num-anc) (and-let* ((left-lst (draft:ast-expr (cadr op) 0)) (right-lst (draft:ast-expr (caddr op) 0))) (let ((cmp-op (sxml:relational-cmp (cadr (assq (car op) `((< ,<) (> ,>) (<= ,<=) (>= ,>=)))))) (left (car left-lst)) (right (car right-lst))) (cons (lambda (nodeset position+size var-binding) (cmp-op (draft:contextset->nodeset (left nodeset position+size var-binding)) (draft:contextset->nodeset (right nodeset position+size var-binding)))) (draft:na-max (cdr left-lst) (cdr right-lst))))))
{14} <AdditiveExpr> ::= (+ <Expr> <Expr> ) | (- <Expr> <Expr>? ) NOTE: num-anc is dummy here, since it is always 0 for AdditiveExpr
(define (draft:ast-additive-expr op num-anc) (let ((expr-res-lst (map (lambda (expr) (draft:ast-expr expr 0)) (cdr op)))) (if (member #f expr-res-lst) ; error detected #f (let ((add-op (cadr (assq (car op) `((+ ,+) (- ,-))))) (expr-impls (map car expr-res-lst))) (cons (lambda (nodeset position+size var-binding) (apply add-op (map (lambda (expr) (sxml:number (draft:contextset->nodeset (expr nodeset position+size var-binding)))) expr-impls))) (apply draft:na-max (map cdr expr-res-lst)))))))
{15} <MultiplicativeExpr> ::= (* <Expr> <Expr> ) | (div <Expr> <Expr> ) | (mod <Expr> <Expr> ) NOTE: num-anc is dummy here, since it is always 0 for MultiplicativeExpr
(define (draft:ast-multiplicative-expr op num-anc) (and-let* ((left-lst (draft:ast-expr (cadr op) 0)) (right-lst (draft:ast-expr (caddr op) 0))) (let ((mul-op (cadr (assq (car op) `((* ,*) (div ,/) (mod ,remainder))))) (left (car left-lst)) (right (car right-lst))) (cons (lambda (nodeset position+size var-binding) (mul-op (sxml:number (draft:contextset->nodeset (left nodeset position+size var-binding))) (sxml:number (draft:contextset->nodeset (right nodeset position+size var-binding))))) (draft:na-max (cdr left-lst) (cdr right-lst))))))
{16} <UnionExpr> ::= (union-expr <Expr> <Expr>+ )
(define (draft:ast-union-expr op num-anc) (let ((expr-res-lst (map (lambda (expr) (draft:ast-expr expr 0)) (cdr op)))) (if (member #f expr-res-lst) ; error detected #f (let ((expr-impls (map car expr-res-lst))) (cons (lambda (nodeset position+size var-binding) (let rpt ((res '()) (fs expr-impls)) (if (null? fs) res (let ((nset ((car fs) nodeset position+size var-binding))) (rpt (append res (cond ((not (nodeset? nset)) (sxml:xpointer-runtime-error "expected - nodeset instead of " nset) '()) (else nset))) (cdr fs)))))) (apply draft:na-max (map cdr expr-res-lst)))))))
{17} <PathExpr> ::= (path-expr <FilterExpr> <Step>+ )
(define (draft:ast-path-expr op num-anc) (and-let* ((steps-res (draft:ast-step-list (cddr op) num-anc)) (filter-lst (draft:ast-filter-expr (cadr op) (cdr steps-res)))) (let ((init-impl (car filter-lst)) (converters (car steps-res))) (cons (lambda (nodeset position+size var-binding) (let ((nset (init-impl nodeset position+size var-binding))) (let rpt ((nset (cond ((nodeset? nset) nset) (else (sxml:xpointer-runtime-error "expected - nodeset instead of " nset) '()))) (fs converters)) (if (null? fs) nset (rpt ((car fs) nset position+size var-binding) (cdr fs)))))) (cdr filter-lst)))))
{18} <FilterExpr> ::= (filter-expr (primary-expr <Expr> ) <Predicate>* )
(define (draft:ast-filter-expr op num-anc) (cond ((not (eq? (car op) 'filter-expr)) (draft:signal-semantic-error "not an FilterExpr - " op)) ((not (eq? (caadr op) 'primary-expr)) (draft:signal-semantic-error "not an PrimaryExpr - " (cadr op))) ((null? (cddr op)) ; no Predicates (draft:ast-expr (cadadr op) num-anc)) (else (and-let* ((preds-res (draft:ast-predicate-list (cddr op) 0)) (expr-lst (draft:ast-expr (cadadr op) (draft:na-max num-anc (cdr preds-res))))) (let ((expr-impl (car expr-lst)) (pred-impl-lst (car preds-res))) (cons (lambda (nodeset position+size var-binding) (let ((prim-res (expr-impl nodeset position+size var-binding))) (let loop ((nset (cond ((nodeset? prim-res) prim-res) (else (sxml:xpointer-runtime-error "expected - nodeset instead of " prim-res) '()))) (preds pred-impl-lst)) (if (null? preds) nset (loop ((car preds) nset position+size var-binding) (cdr preds)))))) (cdr expr-lst)))))))
{19} <VariableReference> ::= (variable-reference <String> )
(define (draft:ast-variable-reference op num-anc) (let ((name (string->symbol (cadr op)))) (cons (lambda (nodeset position+size var-binding) (cond ((assoc name var-binding) => cdr) (else (sxml:xpointer-runtime-error "unbound variable - " name) '()))) 0)))
{20} <Literal> ::= (literal <String> )
(define (draft:ast-literal op num-anc) (let ((literal (cadr op))) (cons (lambda (nodeset position+size var-binding) literal) 0)))
{21} <Number> :: (number <Number> )
(define (draft:ast-number op num-anc) (let ((number (cadr op))) (cons (lambda (nodeset position+size var-binding) number) 0)))
{22} <FunctionCall> ::= (function-call (function-name <String> ) (argument <Expr> )* )
(define (draft:ast-function-call op num-anc) (let ((core-alist ; (list fun-name min-num-args max-num-args na4res impl) `((last 0 0 0 ,draft:core-last) (position 0 0 0 ,draft:core-position) (count 1 1 0 ,draft:core-count) (id 1 1 #f ,draft:core-id) (local-name 0 1 0 ,draft:core-local-name) (namespace-uri 0 1 0 ,draft:core-namespace-uri) (name 0 1 0 ,draft:core-name) (string 0 1 0 ,draft:core-string) (concat 2 -1 0 ,draft:core-concat) (starts-with 2 2 0 ,draft:core-starts-with) (contains 2 2 0 ,draft:core-contains) (substring-before 2 2 0 ,draft:core-substring-before) (substring-after 2 2 0 ,draft:core-substring-after) (substring 2 3 0 ,draft:core-substring) (string-length 0 1 0 ,draft:core-string-length) (normalize-space 0 1 0 ,draft:core-normalize-space) (translate 3 3 0 ,draft:core-translate) (boolean 1 1 0 ,draft:core-boolean) (not 1 1 0 ,draft:core-not) (true 0 0 0 ,draft:core-true) (false 0 0 0 ,draft:core-false) (lang 1 1 #f ,draft:core-lang) (number 0 1 0 ,draft:core-number) (sum 1 1 0 ,draft:core-sum) (floor 1 1 0 ,draft:core-floor) (ceiling 1 1 0 ,draft:core-ceiling) (round 1 1 0 ,draft:core-round)))) (cond ((not (eq? (caadr op) 'function-name)) (draft:signal-semantic-error "not an FunctionName - " (cadr op))) ((assq (string->symbol (cadadr op)) core-alist) => (lambda (description) ; Core function found (cond ((< (length (cddr op)) (cadr description)) (draft:signal-semantic-error "too few arguments for the Core Function call - " (cadadr op))) ((and (>= (caddr description) 0) (> (length (cddr op)) (caddr description))) (draft:signal-semantic-error "too many arguments for the Core Function call - " (cadadr op))) (else ; correct number of arguments (and-let* ((args-impl (draft:ast-function-arguments (cddr op)))) (cons ; Producing a function implementation (apply (list-ref description 4) num-anc args-impl) (list-ref description 3))))))) (else ; function definition not found (draft:signal-semantic-error "function call to an unknown function - " (cadadr op))))))
{22a} ( (argument <Expr> )* ) na-lst - number of ancestors required for each of the arguments Returns: (listof expr-impl) or #f
(define (draft:ast-function-arguments op-lst) (let ((arg-res-lst (map (lambda (op) (if (not (eq? (car op) 'argument)) (draft:signal-semantic-error "not an Argument - " op) (draft:ast-expr (cadr op) 0))) op-lst))) (if (member #f arg-res-lst) ; semantic error detected #f (map car arg-res-lst))))
{25} <XPointer> ::= <ChildSeq> | <FullXPtr> | <Expr>
(define (draft:ast-xpointer op num-anc) (case (car op) ((child-seq) (draft:ast-child-seq op num-anc)) ((full-xptr) (draft:ast-full-xptr op num-anc)) (else (draft:ast-expr op num-anc))))
{26} <ChildSeq> ::= (child-seq (name <String> )) | (child-seq (name <String> )? (number <Number> )+ )
(define (draft:ast-child-seq op num-anc) (if (eq? (caadr op) 'name) (and-let* ((numbers-res (draft:ast-number-list (cddr op) num-anc))) (let ((id-value (cadadr op)) (converters (car numbers-res)) (num-ancestors (cdr numbers-res))) (cons (lambda (nodeset position+size var-binding) (let* ((root-node (draft:reach-root nodeset)) (id-nset ((sxml:child (ntype?? 'id-index)) ((sxml:child (ntype?? '@@)) root-node)))) (if (null? id-nset) ; no id-index '() (let ((nd (sxml:lookup id-value (cdar id-nset)))) (if (not nd) '() (let rpt ((nset (if (and num-ancestors (zero? num-ancestors)) (list nd) (draft:recover-contextset (list nd) root-node num-ancestors))) (fs converters)) (if (null? fs) nset (rpt ((car fs) nset) (cdr fs))))))))) #f))) (and-let* ((numbers-res (draft:ast-number-list (cdr op) num-anc))) (let ((converters (car numbers-res))) (cons (lambda (nodeset position+size var-binding) (let ((child-seq-impl (lambda (node) (let rpt ((nset nodeset) (fs converters)) (if (null? fs) nset (rpt ((car fs) nset) (cdr fs))))))) (if (nodeset? nodeset) (map-union child-seq-impl nodeset) (child-seq-impl nodeset)))) (cdr numbers-res))))))
{26a} ( (number <Number> )+ ) Returns (cons (listof sxpath-converter) num-anc) or #f
(define (draft:ast-number-list number-lst num-anc) (let loop ((to-view (reverse number-lst)) (res-lst '()) (num-anc num-anc)) (cond ((null? to-view) ; everyone processed (cons res-lst num-anc)) ((not (eq? (caar to-view) 'number)) (draft:signal-semantic-error "not an Number - " (car to-view))) (else (loop (cdr to-view) (cons (draft:child (ntype?? '*) num-anc) (cons (node-pos (cadar to-view)) res-lst)) (draft:na-minus-nneg num-anc 1))))))
{27} <FullXPtr> ::= (full-xptr <Expr> <Expr>+ )
(define (draft:ast-full-xptr op num-anc) (let ((expr-res-lst (map (lambda (expr) (draft:ast-expr expr 0)) (cdr op)))) (if (member #f expr-res-lst) ; error detected #f (let ((expr-impls (map car expr-res-lst))) (cons (lambda (nodeset position+size var-binding) (let rpt ((fs expr-impls)) (if (null? fs) '() (let ((nset ((car fs) nodeset position+size var-binding))) (if (null? nset) (rpt (cdr fs)) nset))))) (apply draft:na-max (map cdr expr-res-lst)))))))