eligibleitemservice.rb 12 block in item_ids(...)
10 response = Faraday.new(url: bibdatabase).get("bibliographic/#{sourcemetadataidentifier}/items") 11 items = JSON.parse(response.body).flatmap do |location, holdings| 12 holdings.flatmap do |holding| 13 holding["items"] 14 end
This is happening when voyager is down at am. The service cannot retrieve items.
remote_record.rb 95 jsonld(...)
93 94 def jsonld 95 @jsonld ||= MultiJson.load(jsonldrequest.body, symbolizekeys: true) 96 end
rescue when a record is not found or is suppressed. Bibdata returns: 'Record resource_id
not found or suppressed'",
@escowles , I have a ghost of a memory from the great PULFAlight wireframe demos @sdellis presented. They had a color coded content access visual. it would be nice to try to standardize at least the colors for something like that for all of our applications, perhaps?
labeled
by Esmé Cowles at 2020-09-09 22:08:39.mentioned
by Shaun Ellis at 2020-09-10 14:02:48.subscribed
by Shaun Ellis at 2020-09-10 14:02:49.mentioned
by Esmé Cowles at 2020-09-10 14:02:49.subscribed
by Esmé Cowles at 2020-09-10 14:02:49.Here is the complete example (synced to Figgy DAO workflow) - https://figgy.princeton.edu/catalog/b1cd5592-19bb-4a18-b370-b286194e2a90
labeled
by Christina Chortaria at 2020-09-10 12:05:15.assigned
by Christina Chortaria at 2020-09-10 12:05:15.This location is in bibdata.princeton.edu and bibdata-staging.princeton.edu
closed
by None at 2020-09-10 12:09:16.Needs test for FormattingConcern.validxml? , and FormattingConcern.recordstoxmlstring
Adds on the homepage:
Coverage decreased (-0.04%) to 80.108% when pulling<PHONE_NUMBER>9c7b1c1426cfbd4ca273e6f05d9a09 on alma-implementation-adapter-bib into 0432971bf85b61677fb53547cb6b43be3640ae46 on master.
This Pr needs more tests but it would be nice to have a review.
deployed
by Trey Pendragon at 2020-09-10 16:20:50.renamed
by Christina Chortaria at 2020-09-10 16:37:17.Coverage decreased (-0.3%) to 79.803% when pulling 3dfd5fd4e7388681bd55ce65e13bead8794969e6 on alma-implementation into 0432971bf85b61677fb53547cb6b43be3640ae46 on master.
head_ref_force_pushed
by Christina Chortaria at 2020-09-10 11:55:37.head_ref_force_pushed
by Christina Chortaria at 2020-09-10 13:51:20.head_ref_force_pushed
by Christina Chortaria at 2020-09-10 13:54:56.renamed
by Christina Chortaria at 2020-09-10 16:37:39.closing this for now.
closed
by Christina Chortaria at 2020-09-10 16:38:31.closed
by Kevin Reiss at 2020-09-10 02:07:00.referenced
by Christina Chortaria at 2020-09-10 11:40:29.merged
by Christina Chortaria at 2020-09-10 11:40:29.closed
by Christina Chortaria at 2020-09-10 11:40:29.closed
by None at 2020-09-10 12:46:46.referenced
by None at 2020-09-10 12:46:48.referenced
by None at 2020-09-10 12:46:46.merged
by None at 2020-09-10 12:46:46.closed
by None at 2020-09-10 12:46:47.@hackmastera I'm approving this now but it has a conflict.
oh nice you just pushed :)
@hackmastera I'm approving this now but it has a conflict.
thanks; yes I was just fixing it. conflicted with merge of my previous pr.
Coverage remained the same at 96.75% when pulling 57ef3c4dd13c0ef55f38a08f50ac8ecbcb06a8e3 on 2237-etas-charged-no-link into 6571f552c9c6ac041d0f039adfe4e1f6d0fff0ae on master.
head_ref_force_pushed
by None at 2020-09-10 12:49:01.mentioned
by None at 2020-09-10 12:49:02.subscribed
by None at 2020-09-10 12:49:02.mentioned
by None at 2020-09-10 12:49:44.subscribed
by None at 2020-09-10 12:49:44.referenced
by None at 2020-09-10 13:15:16.merged
by None at 2020-09-10 13:15:16.closed
by None at 2020-09-10 13:15:16.I think all checked_out_statuses
would apply, yes.
referenced
by None at 2020-09-10 12:49:00.closed
by None at 2020-09-10 13:15:16.referenced
by None at 2020-09-10 13:15:17.labeled
by Axa Mei Liauw at 2020-09-10 19:12:43.Based on stakeholder feedback, I've revised and added technical implementation details (see issue abolve). We're getting click-through language currently.
We want a pop-up click-through notification for every page? That seems pretty bad
We have plenty of real-estate in the viewer section that we could just display the disclaimer with the link to Google Books — that seems like it would be less annoying than a click-through, right?
Kim, would you please ask the curators to provide links to the proper finding-aid components for the following two items:
http://arks.princeton.edu/ark:/88435/cc08hg91z --> ??? http://arks.princeton.edu/ark:/88435/kh04dq988 --> ???
If possible, it would also be useful for them to verify that they have been properly ingested into Figgy.
@cwulfman : contacted Chloe Pfendler from SC, who has worked/is working on Fitzgerald as a good place to start.
assigned
by Kim Leaman at 2020-09-10 15:00:06.mentioned
by Cliff Wulfman at 2020-09-10 16:23:46.subscribed
by Cliff Wulfman at 2020-09-10 16:23:46.@cwulfman we still need the collection tag "Latin American and Iberian Studies Collections" added to all items, so that they can map to the DPUL site. the GNIB collection is a sub collection of the whole.
mentioned
by Cliff Wulfman at 2020-09-10 23:04:20.subscribed
by Cliff Wulfman at 2020-09-10 23:04:20.PUDL0025 needs collection tag: Latin American and Iberian Studies Collections added to all items so that it maps to DPUL exhibit.
@cwulfman was this ingested as an ephemera project like discussed above?
Ah, i see the problem. it was ingested as "Princeton Slavic Collections" Project. It needs to be titled: Print Ephemera from the 2013 Moscow Mayoral Election
The secondary collection tag (Princeton Slavic Collections) needs to be added at the item level, in the collections pulldown menu.
mentioned
by Cliff Wulfman at 2020-09-10 23:28:08.subscribed
by Cliff Wulfman at 2020-09-10 23:28:08.assigned
by Trey Pendragon at 2020-09-09 23:05:59.We will also need a way to merge them back into the data.
Kamino cloned this issue to pulibrary/archivesspace-development
mentioned
by None at 2020-09-10 14:39:34.mentioned
by Will-Clements at 2020-09-10 14:45:15.subscribed
by Will-Clements at 2020-09-10 14:45:15.unsubscribed
by None at 2020-09-10 14:45:15.labeled
by None at 2020-09-10 16:02:32.labeled
by None at 2020-09-10 16:02:32.Where are we pulling hours data from? I think I'm gonna break that ticket out and just frame it out to close this ticket, but it'd be good to know.
assigned
by Trey Pendragon at 2020-09-10 17:28:44.@jrgriffiniii What's blocking this ticket?
mentioned
by James R. Griffin III at 2020-09-10 17:30:03.subscribed
by James R. Griffin III at 2020-09-10 17:30:03.@eliotjordan and I recommend we close this, as it seems difficult and unnecessary for the MVP. Cool, @jrgriffiniii ?
mentioned
by Eliot Jordan at 2020-09-10 17:45:26.subscribed
by Eliot Jordan at 2020-09-10 17:45:26.mentioned
by James R. Griffin III at 2020-09-10 17:45:26.subscribed
by James R. Griffin III at 2020-09-10 17:45:26.head_ref_force_pushed
by Eliot Jordan at 2020-09-10 21:34:23.deployed
by Trey Pendragon at 2020-09-10 21:36:17.referenced
by Eliot Jordan at 2020-09-10 21:39:58.merged
by Eliot Jordan at 2020-09-10 21:39:58.closed
by Eliot Jordan at 2020-09-10 21:39:58.head_ref_deleted
by Eliot Jordan at 2020-09-10 21:40:01.deployed
by Trey Pendragon at 2020-09-10 21:40:53.referenced
by Eliot Jordan at 2020-09-10 22:25:30.merged
by Eliot Jordan at 2020-09-10 22:25:30.closed
by Eliot Jordan at 2020-09-10 22:25:30.head_ref_deleted
by Eliot Jordan at 2020-09-10 22:25:34.Close in favor of https://github.com/pulibrary/pulfalight/pull/373
closed
by Eliot Jordan at 2020-09-10 22:26:09.head_ref_deleted
by Eliot Jordan at 2020-09-10 22:26:14.@dependabot rebase
mentioned
by Dependabot at 2020-09-10 22:26:39.head_ref_force_pushed
by None at 2020-09-10 22:27:25.deployed
by Trey Pendragon at 2020-09-10 22:28:08.referenced
by Eliot Jordan at 2020-09-10 22:42:52.merged
by Eliot Jordan at 2020-09-10 22:42:52.closed
by Eliot Jordan at 2020-09-10 22:42:52.head_ref_deleted
by Eliot Jordan at 2020-09-10 22:42:56.labeled
by None at 2020-09-10 22:44:26.labeled
by None at 2020-09-10 22:44:26.Have confirmed requests for Columbia EDD materials go through.
referenced
by Kevin Reiss at 2020-09-10 02:07:00.merged
by Kevin Reiss at 2020-09-10 02:07:00.closed
by Kevin Reiss at 2020-09-10 02:07:00.head_ref_deleted
by Kevin Reiss at 2020-09-10 02:07:05.I believe this ticket can be closed. The only location where etas is being checked alone it related to the location hidden field and if the item is recap. If it is recap it will eventually end up in the etasrcp location, which has recap set as it's holding location. The ones still left in etas for the moment will get caught by the 'etas' check.
Double checking with Liza and Nick via email to make sure we should change this.
Here is screen capture of the old code running on borrow direct:
Gem used to interact with API from our Borrow Direct system: https://github.com/jrochkind/borrow_direct.
This route was used via AJAX by the form to search BD for a direct match via standard number, https://github.com/pulibrary/requests/blob/master/config/routes.rb#L3. If that failed the screenshot above would appear. If it succeeded the form would be set-up to allow the user to submit a direct request for the item to Borrow Direct. The borrow direct system handles the patron notification so we would generate no emails on our side when a user would select that option.
referenced
by None at 2020-09-10 17:18:27.labeled
by Kevin Reiss at 2020-09-10 22:49:29.referenced
by Kevin Reiss at 2020-09-09 23:10:21.merged
by Kevin Reiss at 2020-09-09 23:10:21.closed
by Kevin Reiss at 2020-09-09 23:10:21.head_ref_deleted
by Kevin Reiss at 2020-09-09 23:10:26.closed
by Axa Mei Liauw at 2020-09-10 13:25:22.closed
by Axa Mei Liauw at 2020-09-10 13:25:33.Not needed
closed
by Axa Mei Liauw at 2020-09-10 13:25:46.closed
by Axa Mei Liauw at 2020-09-10 13:25:55.Additional tasks:
closed
by Kevin Reiss at 2020-09-10 18:55:49.referenced
by Kevin Reiss at 2020-09-10 18:55:49.merged
by Kevin Reiss at 2020-09-10 18:55:49.closed
by Kevin Reiss at 2020-09-10 18:55:49.head_ref_deleted
by Kevin Reiss at 2020-09-10 18:55:53.


It's time to design your email.Now that you've selected a template, you'll define the layout of your email and give your content a place to live by adding, rearranging, and deleting content blocks. When you're ready to change the look of your email, take a look through the “design” tab to set background colors, borders, and other styles. If you need a bit of inspiration, you can see what other MailChimp users are doing, or learn about email design and blaze your own trail.
|


sha2loader
Do you trust bootstrapcdn? cdnjs? aspnetcdn? googlecdn?
You shouldn't need to.
You shouldn't need to.
Sha2loader acts as a proof-of-concept async asset loader and integrity verifier for scripts / css / images / or fonts that are hosted on servers outside your control. It lets you verify that each asset is exactly what you expected before using it. This could help mitigate the impact of public-CDN compromise or just reduce the number of your own servers that you need to trust.
How it works:
Load the sha2loader script (preferably compressed together with sjcl and hosted on your own server) at the top of your page. You can then include tags with the data-sha and data-href/url attributes. You can also include a template to render css with blob-urls (for font loading). You'll need to specify urls that allow cross origin resource shraring.
This page loads bootstrap.css, d3.js, jquery.js, font-awesome icons, and a jpg image using several distinct CDNs.
Under the hood
The loader.js code is super simple. DOM modifications are picked up with a MutationObserver; any freshly inserted nodes containing the data-sha attribute are hijacked. The coresponding resources are loaded with XMLHttpRequests that have responseType='arraybuffer'. It's relatively fast and easy to feed the resulting xhr respone into SJCL for hashing and then to convert it in to a blob-url for use. The whole process has significantly less overhead that I originally expected.
On a practical note
Most CDNs are probably far more secure than your server, this is experimental code, and the RightWay™ to do this might involve adding native hash-checking support to the HTML spec.
It could be neat to mash this up with ideas from basket.js (like localStorage caching and some tpye of dependency management).


|
My Project
|
A parameter with a formal backing Symbol. More...
#include <fspec.hh>
Public Member Functions | |
| ParameterSymbol (void) | |
| Constructor. | |
| virtual const string & | getName (void) const |
| Get the name of the parameter ("" for return value) | |
| virtual Datatype * | getType (void) const |
| Get the data-type associate with this. | |
| virtual Address | getAddress (void) const |
| Get the storage address for this parameter. | |
| virtual int4 | getSize (void) const |
| Get the number of bytes occupied by this parameter. | |
| virtual bool | isTypeLocked (void) const |
| Is the parameter data-type locked. | |
| virtual bool | isNameLocked (void) const |
| Is the parameter name locked. | |
| virtual bool | isSizeTypeLocked (void) const |
| Is the size of the parameter locked. | |
| virtual bool | isIndirectStorage (void) const |
| Is this really a pointer to the true parameter. | |
| virtual bool | isHiddenReturn (void) const |
| Is this a pointer to storage for a return value. | |
| virtual bool | isNameUndefined (void) const |
| Is the name of this parameter undefined. | |
| virtual void | setTypeLock (bool val) |
| Toggle the lock on the data-type. | |
| virtual void | setNameLock (bool val) |
| Toggle the lock on the name. | |
| virtual void | overrideSizeLockType (Datatype *ct) |
| Change (override) the data-type of a size-locked parameter. More... | |
| virtual void | resetSizeLockType (TypeFactory *factory) |
| Clear this parameter's data-type preserving any size-lock. More... | |
| virtual ProtoParameter * | clone (void) const |
| Clone the parameter. | |
| virtual Symbol * | getSymbol (void) const |
| Retrieve the formal Symbol associated with this parameter. More... | |
| Public Member Functions inherited from ProtoParameter | |
| ProtoParameter (void) | |
| Constructor. | |
| virtual | ~ProtoParameter (void) |
| Destructor. | |
| bool | operator== (const ProtoParameter &op2) const |
| Compare storage location and data-type for equality. More... | |
| bool | operator!= (const ProtoParameter &op2) const |
| Compare storage location and data-type for inequality. More... | |
Friends | |
| class | ProtoStoreSymbol |
A parameter with a formal backing Symbol.
Input parameters generally have a symbol associated with them. This class holds a reference to the Symbol object and pulls the relevant parameter information off of it.
|
virtual |
Retrieve the formal Symbol associated with this parameter.
If there is no backing symbol an exception is thrown
Implements ProtoParameter.
|
virtual |
Change (override) the data-type of a size-locked parameter.
The original parameter must have a type-lock and TYPE_UNKNOWN data-type. The size-lock is preserved and this can be cleared back to its TYPE_UNKNOWN state.
| ct | is the overriding data-type |
Implements ProtoParameter.
|
virtual |
Clear this parameter's data-type preserving any size-lock.
The data-type is converted to a TYPE_UNKNOWN of the same size
| factory | is the TypeFactory that will construct the unknown data-type |
Implements ProtoParameter.


Scii.Fi
World leading paradigm disruptor in the decentralized space.
Find us at<EMAIL_ADDRESS>Github
|
Medium
|
Twitter
|
Discord
|
Telegram


| DOSE: T+ 0:00 |
250 mg |
oral |
bk-MBDB |
(capsule) |
| T+ 1:17 |
50 mg |
oral |
bk-MBDB |
(powder / crystals) |
The spacemonkey have some but limited experience of MDMA and Methylone. A slight hangover since yesterday night involving a couple of beers and drinks made me irresolute to do this trial but I went on anyway. Had b-vitamin complex in the morning and 360 mg Magnesium after dinner. Home alone in the sofa.
21:08
Swallowed a gel-capsule with 150mg butylone/bk-mbdb.
21:34
Lighter stimulating effects.
21:50
Mild empathogenic effects, mind is clear and my body begins to feel warm, slight restlessness.
22:25
The effects developed to a mild plateau from 22:00. This is ok, but I intended to get higher this night. I can imagine that it would be beautiful to add MJ on top of this, but I chose to supplement with 50 mg nasally since I'm having a break from MJ.
I tried to listen to Eat Static - Implant/De-classified which I usually consider as brilliant trance but was not in the mood, Zap Mama - Ancestry in progress gave more room for introspection, and so did reggae.
22:57
Ah, this is what I intended tonight. It is very pleasant, euphoric, this material has therapeutic potential, but it is not very tactile. Some jaw tension. Music sounds beautiful and introspection is honest and forgiving. Did some N20 but the synergy was less than with LSD.
23:26
Peak is over, still pleasant.
00:23
I feel uncomfortable speedy and wasted. Hydrating. Still pleasant in some way, but I understand why some might experience crashing at this point.
1:17 Start to get really hungry.
Went to bed at 5, slept bad, had brain-movies instead of dreams and went up at 9. I still feel the body buzz and pupils are slightly dilated, I didn't expected after effects to be that long lasting. I need sleeping pills/downers for this one. Felt somewhat unfocused during the day, but no hangover.
This material has a quite strong push, which is neutral rather than positive in its nature. I question if one can have real transcendental experiences on bk-MBDB, but I still think it behaved as expected except for the long tail. I will consume what I have left but not buy any more. I expect it to be excellent in social settings.
Personally, I always enjoy to get wasted but I also think it gave me valuable time to summarize my life and identify behavioural patterns which causes unnecessary stress and life force degeneration. Quite subtle things actually, and not any major insights.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


typealias SingleOutputFitnessFunction<TData> = FitnessFunction<TData, Single<TData>>
A FitnessFunction for lgp.core.program.Programs with a single output.


Eydean’s Community Outreach is the initiative started with the Eydean Open Source Community which is an organization developing software applications for social change using a wide-range of technologies. Projects range from Free and Open Source software, to design, graphics and hardware. We frequently organize and participate in conferences, meetups and code camps. The annual Eydean OpenTechSummit is one of the largest gatherings of developers in Asia and took place in Kathmandu and Pokhara.
What We Do
We bring amazing people together to create, develop, design and make things with Open Technologies - hardware and software - and share our work for the benefit of all. We organize Open Tech summits, science hack labs, meetups and coding programs with developers, designers and contributors. We also incubate projects into companies to support the development of a sustainable FOSS ecosystem.
Why We Do It
Our main goal is to improve people’s lives by sharing Open Tech solutions. We want to see that information technology and science has a positive impact on our society. We believe this can be achieved if people have access to digital tools and knowledge. Open Technologies offer free and open access. At Eydean we are excited how sharing is possible on all layers from software, hardware and design to data and knowledge and we work hard to enable people to participate in the sharing society, expand knowledge, tools and opportunities, freedom of communication and expression for everyone.
Who We Are
We are an organization of people from all districts based in Nepal. We want to see progress and improvements of people’s lives in Nepal and everywhere. We are developers, designers, event organizers and contributors who want to learn and share ideas, create and make digital software tools and hardware, that benefit people around the world.


Next: find-method, Previous: compute-applicable-methods, Up: Objects Dictionary
define-method-combination
name [[!short-form-option]]
⇒ name
define-method-combination
name lambda-list
({method-group-specifier}*)
[(:arguments . args-lambda-list)]
[(:generic-function
generic-function-symbol)]
[[{declaration}* | documentation]]
{form}*
⇒ name
short-form-option ::=:documentation documentation | :identity-with-one-argument identity-with-one-argument | :operator operator
method-group-specifier ::=(name {{qualifier-pattern}^+ | predicate} [[!long-form-option]])
long-form-option ::=:description description | :order order | :required required-p
args-lambda-list— a define-method-combination arguments lambda list.
declaration—a declare expression; not evaluated.
description—a format control.
documentation—a string; not evaluated.
forms—an implicit progn that must compute and return the form that specifies how the methods are combined, that is, the effective method.
generic-function-symbol—a symbol.
identity-with-one-argument—a generalized boolean.
lambda-list—ordinary lambda list.
name—a symbol. Non-keyword, non-nil symbols are usually used.
operator—an operator. Name and operator are often the same symbol. This is the default, but it is not required.
order—:most-specific-first or :most-specific-last; evaluated.
predicate—a symbol that names a function of one argument that returns a generalized boolean.
qualifier-pattern—a list, or the symbol *.
required-p—a generalized boolean.
The macro define-method-combination is used to define new types of method combination.
There are two forms of define-method-combination. The short form is a simple facility for the cases that are expected to be most commonly needed. The long form is more powerful but more verbose. It resembles defmacro in that the body is an expression, usually using backquote, that computes a form. Thus arbitrary control structures can be implemented. The long form also allows arbitrary processing of method qualifiers.
The short form syntax of define-method-combination is recognized when the second subform is a non-nil symbol or is not present. When the short form is used, name is defined as a type of method combination that produces a Lisp form (operator method-call method-call ...). The operator is a symbol that can be the name of a function, macro, or special operator. The operator can be supplied by a keyword option; it defaults to name.
Keyword options for the short form are the following:
The :documentation option is used to document the method-combination type; see description of long form below.
The :identity-with-one-argument option enables an optimization when its value is true (the default is false). If there is exactly one applicable method and it is a primary method, that method serves as the effective method and operator is not called. This optimization avoids the need to create a new effective method and avoids the overhead of a function call. This option is designed to be used with operators such as progn, and, +, and max.
The :operator option specifies the name of the operator. The operator argument is a symbol that can be the name of a function, macro, or special form.
These types of method combination require exactly one qualifier per method. An error is signaled if there are applicable methods with no qualifiers or with qualifiers that are not supported by the method combination type.
A method combination procedure defined in this way recognizes two roles for methods. A method whose one qualifier is the symbol naming this type of method combination is defined to be a primary method. At least one primary method must be applicable or an error is signaled. A method with :around as its one qualifier is an auxiliary method that behaves the same as an around method in standard method combination. The function call-next-method can only be used in around methods; it cannot be used in primary methods defined by the short form of the define-method-combination macro.
A method combination procedure defined in this way accepts an optional argument named order, which defaults to :most-specific-first. A value of :most-specific-last reverses the order of the primary methods without affecting the order of the auxiliary methods.
The short form automatically includes error checking and support for around methods.
For a discussion of built-in method combination types, see Built-in Method Combination Types.
The long form syntax of define-method-combination is recognized when the second subform is a list.
The lambda-list receives any arguments provided after the name of the method combination type in the :method-combination option to defgeneric.
A list of method group specifiers follows. Each specifier selects a subset of the applicable methods to play a particular role, either by matching their qualifiers against some patterns or by testing their qualifiers with a predicate. These method group specifiers define all method qualifiers that can be used with this type of method combination.
The car of each method-group-specifier is a symbol which names a variable. During the execution of the forms in the body of define-method-combination, this variable is bound to a list of the methods in the method group. The methods in this list occur in the order specified by the :order option.
If qualifier-pattern is a symbol it must be *. A method matches a qualifier-pattern if the method’s list of qualifiers is equal to the qualifier-pattern (except that the symbol * in a qualifier-pattern matches anything). Thus a qualifier-pattern can be one of the following: the empty list, which matches unqualified methods; the symbol *, which matches all methods; a true list, which matches methods with the same number of qualifiers as the length of the list when each qualifier matches the corresponding list element; or a dotted list that ends in the symbol * (the * matches any number of additional qualifiers).
Each applicable method is tested against the qualifier-patterns and predicates in left-to-right order. As soon as a qualifier-pattern matches or a predicate returns true, the method becomes a member of the corresponding method group and no further tests are made. Thus if a method could be a member of more than one method group, it joins only the first such group. If a method group has more than one qualifier-pattern, a method need only satisfy one of the qualifier-patterns to be a member of the group.
The name of a predicate function can appear instead of qualifier-patterns in a method group specifier. The predicate is called for each method that has not been assigned to an earlier method group; it is called with one argument, the method’s qualifier list. The predicate should return true if the method is to be a member of the method group. A predicate can be distinguished from a qualifier-pattern because it is a symbol other than nil or *.
If there is an applicable method that does not fall into any method group, the function invalid-method-error is called.
Method group specifiers can have keyword options following the qualifier patterns or predicate. Keyword options can be distinguished from additional qualifier patterns because they are neither lists nor the symbol *. The keyword options are as follows:
The :description option is used to provide a description of the role of methods in the method group. Programming environment tools use (apply #'format stream format-control (method-qualifiers method)) to print this description, which is expected to be concise. This keyword option allows the description of a method qualifier to be defined in the same module that defines the meaning of the method qualifier. In most cases, format-control will not contain any format directives, but they are available for generality. If :description is not supplied, a default description is generated based on the variable name and the qualifier patterns and on whether this method group includes the unqualified methods.
The :order option specifies the order of methods. The order argument is a form that evaluates to :most-specific-first or :most-specific-last. If it evaluates to any other value, an error is signaled. If :order is not supplied, it defaults to :most-specific-first.
The :required option specifies whether at least one method in this method group is required. If its value is true and the method group is empty (that is, no applicable methods match the qualifier patterns or satisfy the predicate), an error is signaled. If :required is not supplied, it defaults to nil.
The use of method group specifiers provides a convenient syntax to select methods, to divide them among the possible roles, and to perform the necessary error checking. It is possible to perform further filtering of methods in the body forms by using normal list-processing operations and the functions method-qualifiers and invalid-method-error. It is permissible to use setq on the variables named in the method group specifiers and to bind additional variables. It is also possible to bypass the method group specifier mechanism and do everything in the body forms. This is accomplished by writing a single method group with * as its only qualifier-pattern; the variable is then bound to a list of all of the applicable methods, in most-specific-first order.
The body forms compute and return the form that specifies how the methods are combined, that is, the effective method. The effective method is evaluated in the null lexical environment augmented with a local macro definition for call-method and with bindings named by symbols not accessible from the COMMON-LISP-USER package. Given a method object in one of the lists produced by the method group specifiers and a list of next methods, call-method will invoke the method such that call-next-method has available the next methods.
When an effective method has no effect other than to call a single method, some implementations employ an optimization that uses the single method directly as the effective method, thus avoiding the need to create a new effective method. This optimization is active when the effective method form consists entirely of an invocation of the call-method macro whose first subform is a method object and whose second subform is nil or unsupplied. Each define-method-combination body is responsible for stripping off redundant invocations of progn, and, multiple-value-prog1, and the like, if this optimization is desired.
The list (:arguments . lambda-list) can appear before any declarations or documentation string. This form is useful when the method combination type performs some specific behavior as part of the combined method and that behavior needs access to the arguments to the generic function. Each parameter variable defined by lambda-list is bound to a form that can be inserted into the effective method. When this form is evaluated during execution of the effective method, its value is the corresponding argument to the generic function; the consequences of using such a form as the place in a setf form are undefined.
Argument correspondence is computed by dividing the :arguments lambda-list and the generic function lambda-list into three sections: the required parameters, the optional parameters, and the keyword and rest parameters. The arguments supplied to the generic function for a particular call are also divided into three sections; the required arguments section contains as many arguments as the generic function has required parameters, the optional arguments section contains as many arguments as the generic function has optional parameters, and the keyword/rest arguments section contains the remaining arguments. Each parameter in the required and optional sections of the :arguments lambda-list accesses the argument at the same position in the corresponding section of the arguments. If the section of the :arguments lambda-list is shorter, extra arguments are ignored. If the section of the :arguments lambda-list is longer, excess required parameters are bound to forms that evaluate to nil and excess optional parameters are bound to their initforms. The keyword parameters and rest parameters in the :arguments lambda-list access the keyword/rest section of the arguments. If the :arguments lambda-list contains &key, it behaves as if it also contained &allow-other-keys.
In addition, &whole var can be placed first in the :arguments lambda-list. It causes var to be bound to a form that evaluates to a list of all of the arguments supplied to the generic function. This is different from &rest because it accesses all of the arguments, not just the keyword/rest arguments.
Erroneous conditions detected by the body should be reported with method-combination-error or invalid-method-error; these functions add any necessary contextual information to the error message and will signal the appropriate error.
The body forms are evaluated inside of the bindings created by the lambda list and method group specifiers.
[Reviewer Note by Barmar: Are they inside or outside the :ARGUMENTS bindings?] Declarations at the head of the body are positioned directly inside of bindings created by the lambda list and outside of the bindings of the method group variables. Thus method group variables cannot be declared in this way. locally may be used around the body, however.
Within the body forms, generic-function-symbol is bound to the generic function object.
Documentation is attached as a documentation string to name (as kind method-combination) and to the method combination object.
Note that two methods with identical specializers, but with different qualifiers, are not ordered by the algorithm described in Step 2 of the method selection and combination process described in Method Selection and Combination. Normally the two methods play different roles in the effective method because they have different qualifiers, and no matter how they are ordered in the result of Step 2, the effective method is the same. If the two methods play the same role and their order matters,
[Reviewer Note by Barmar: How does the system know when the order matters?] an error is signaled. This happens as part of the qualifier pattern matching in define-method-combination.
If a define-method-combination form appears as a top level form, the compiler must make the method combination name be recognized as a valid method combination name in subsequent defgeneric forms. However, the method combination is executed no earlier than when the define-method-combination form is executed, and possibly as late as the time that generic functions that use the method combination are executed.
Most examples of the long form of define-method-combination also illustrate the use of the related functions that are provided as part of the declarative method combination facility.
;;; Examples of the short form of define-method-combination (define-method-combination and :identity-with-one-argument t) (defmethod func and ((x class1) y) ...) ;;; The equivalent of this example in the long form is: (define-method-combination and (&optional (order :most-specific-first)) ((around (:around)) (primary (and) :order order :required t)) (let ((form (if (rest primary) `(and ,@(mapcar #'(lambda (method) `(call-method ,method)) primary)) `(call-method ,(first primary))))) (if around `(call-method ,(first around) (,@(rest around) (make-method ,form))) form))) ;;; Examples of the long form of define-method-combination ;The default method-combination technique (define-method-combination standard () ((around (:around)) (before (:before)) (primary () :required t) (after (:after))) (flet ((call-methods (methods) (mapcar #'(lambda (method) `(call-method ,method)) methods))) (let ((form (if (or before after (rest primary)) `(multiple-value-prog1 (progn ,@(call-methods before) (call-method ,(first primary) ,(rest primary))) ,@(call-methods (reverse after))) `(call-method ,(first primary))))) (if around `(call-method ,(first around) (,@(rest around) (make-method ,form))) form)))) ;A simple way to try several methods until one returns non-nil (define-method-combination or () ((methods (or))) `(or ,@(mapcar #'(lambda (method) `(call-method ,method)) methods))) ;A more complete version of the preceding (define-method-combination or (&optional (order ':most-specific-first)) ((around (:around)) (primary (or))) ;; Process the order argument (case order (:most-specific-first) (:most-specific-last (setq primary (reverse primary))) (otherwise (method-combination-error "~S is an invalid order.~@ :most-specific-first and :most-specific-last are the possible values." order))) ;; Must have a primary method (unless primary (method-combination-error "A primary method is required.")) ;; Construct the form that calls the primary methods (let ((form (if (rest primary) `(or ,@(mapcar #'(lambda (method) `(call-method ,method)) primary)) `(call-method ,(first primary))))) ;; Wrap the around methods around that form (if around `(call-method ,(first around) (,@(rest around) (make-method ,form))) form))) ;The same thing, using the :order and :required keyword options (define-method-combination or (&optional (order ':most-specific-first)) ((around (:around)) (primary (or) :order order :required t)) (let ((form (if (rest primary) `(or ,@(mapcar #'(lambda (method) `(call-method ,method)) primary)) `(call-method ,(first primary))))) (if around `(call-method ,(first around) (,@(rest around) (make-method ,form))) form))) ;This short-form call is behaviorally identical to the preceding (define-method-combination or :identity-with-one-argument t) ;Order methods by positive integer qualifiers ;:around methods are disallowed to keep the example small (define-method-combination example-method-combination () ((methods positive-integer-qualifier-p)) `(progn ,@(mapcar #'(lambda (method) `(call-method ,method)) (stable-sort methods #'< :key #'(lambda (method) (first (method-qualifiers method))))))) (defun positive-integer-qualifier-p (method-qualifiers) (and (= (length method-qualifiers) 1) (typep (first method-qualifiers) '(integer 0 *)))) ;;; Example of the use of :arguments (define-method-combination progn-with-lock () ((methods ())) (:arguments object) `(unwind-protect (progn (lock (object-lock ,object)) ,@(mapcar #'(lambda (method) `(call-method ,method)) methods)) (unlock (object-lock ,object))))
The compiler is not required to perform any compile-time side-effects.
Method combination types defined with the short form require exactly one qualifier per method. An error of type error is signaled if there are applicable methods with no qualifiers or with qualifiers that are not supported by the method combination type. At least one primary method must be applicable or an error of type error is signaled.
If an applicable method does not fall into any method group, the system signals an error of type error indicating that the method is invalid for the kind of method combination in use.
If the value of the :required option is true and the method group is empty (that is, no applicable methods match the qualifier patterns or satisfy the predicate), an error of type error is signaled.
If the :order option evaluates to a value other than :most-specific-first or :most-specific-last, an error of type error is signaled.
‘call-method; make-method’ , call-next-method, documentation; (setf documentation), method-qualifiers, method-combination-error, invalid-method-error, defgeneric, Method Selection and Combination, Built-in Method Combination Types, Syntactic Interaction of Documentation Strings and Declarations
The :method-combination option of defgeneric is used to specify that a generic function should use a particular method combination type. The first argument to the :method-combination option is the name of a method combination type and the remaining arguments are options for that type.
Next: find-method, Previous: compute-applicable-methods, Up: Objects Dictionary